def test_calls_remove_old_flags(self, db_session, patch): Feature = patch("h.tasks.cleanup.models.Feature") purge_removed_features() Feature.remove_old_flags.assert_called_once_with(db_session)