Пример #1
0
 def test_generates_repr_string(self):
     # given
     user = User(email='*****@*****.**')
     user.id = 123
     #when
     r = repr(user)
     # then
     self.assertEqual('User(\'[email protected]\', id=123)', r)
Пример #2
0
 def test_generates_str_string(self):
     # given
     user = User(email='*****@*****.**')
     user.id = 123
     #when
     r = str(user)
     # then
     fmt = 'User(\'[email protected]\', user id=123, id=[{}])'
     expected = fmt.format(id(user))
     self.assertEqual(expected, r)