Refactor database integration tests

Slightly refactor to remove duplication in fixture setup.