def test_str_2(self): "Has the correct string represntation when it has a user" user = UserFactory() account = AccountFactory(user=user) self.assertEqual(account.__str__(), '@%s' % user.screen_name)
def test_str_1(self): "Has the correct string represntation when it has no user" account = AccountFactory(user=None) self.assertEqual(account.__str__(), '%d' % account.pk)