wrote new test function for database. Doesn't test all aspects though