def test_it(self):
Serializer = self._makeOne(self._makeSerializer())
article = self._makeArticle()
result = Serializer(article).data
expected = '{"name": "hello", "content": "hello world", "comments": [{"name": "title0", "content": "hmm"}, {"name": "title1", "content": "hmm"}, {"name": "title2", "content": "hmm"}]}' # NOQA
actual = json.dumps(result)
self.assertEqual(actual, expected)
评论列表
文章目录