Add a missing test case
Add hooks to make it easier to test database related code without an actual database