def delete_record__should_update_most_recent(self): """see ticket:36.""" proj = Project("test_project", record_store=MockRecordStore()) proj.add_record(MockRecord("record1")) self.assertEqual(proj._most_recent, "record1") proj.add_record(MockRecord("record2")) self.assertEqual(proj._most_recent, "record2") proj.delete_record("record2") self.assertEqual(proj._most_recent, "last") # should really be "record1", but we are not testing RecordStore here
def test__delete_record__calls_delete_on_the_record_store(self): proj = Project("test_project", record_store=MockRecordStore()) proj.delete_record("foo") self.assertEqual(proj.record_store.deleted, "foo")