Refactored so that each test starts with a clean database.