Improve database unit testing