def test_repr_multiple_posts(self): b = Blog('Title', 'Author') b.posts = ['post1'] b2 = Blog('My Day', 'Bob') b2.posts = ['Test Blog', 'another'] self.assertEqual(b.__repr__(), 'Title by Author (1 post)') self.assertEqual(b2.__repr__(), 'My Day by Bob (2 posts)')
def test_repr_multiple_posts(self): b = Blog('Test', 'Test Author') b.posts = ['test'] self.assertEqual((b.__repr__()), 'Test by Test Author (1 post)')
def test_repr(self): b = Blog('Test', 'Test Author') self.assertEqual((b.__repr__()), 'Test by Test Author (0 posts)')
def test_repr(self): b = Blog('Title', 'Author') c = Blog('My Day', 'Bob') self.assertEqual(b.__repr__(), 'Title by Author (0 posts)') self.assertEqual(c.__repr__(), 'My Day by Bob (0 posts)')