Fix tests. Mock database connection