def test_generates_repr_string(self): # given att = Attachment(path='/path/to/file') att.id = 123 #when r = repr(att) # then self.assertEqual('Attachment(\'/path/to/file\', id=123)', r)
def test_generates_str_string(self): # given att = Attachment(path='/path/to/file') att.id = 123 #when r = str(att) # then expected = 'Attachment(\'/path/to/file\', attachment id=123, id=[{}])' expected = expected.format(id(att)) self.assertEqual(expected, r)