added test database method and adjusted tests