def test_generates_repr_string(self): # given note = Note(content='content') note.id = 123 #when r = repr(note) # then self.assertEqual('Note(\'content\', id=123)', r)
def test_generates_str_string(self): # given note = Note(content='content') note.id = 123 #when r = str(note) # then fmt = 'Note(\'content\', note id=123, id=[{}])' expected = fmt.format(id(note)) self.assertEqual(expected, r)