def test_json(self): p = Post('Test', 'Test content') self.assertDictEqual({ 'title': p.title, 'content': p.content }, p.json())
def test_json(self): p = Post('Test', 'Test content') expected = {'title': 'Test', 'content': 'Test content'} self.assertDictEqual(expected, p.json())
def test_json(self): p = Post('Test', 'Test Content') expected = {'title': 'Test', 'content': 'Test Content'} # checks that the keys and values are the same as oppposed to the object being the same self.assertDictEqual(expected, p.json())