Add tests for db access