示例#1
0
 def test_entity_images_are_prefixed_to_post_text(self):
     self.comment._children = [
         base.Image(remote_path="foo", remote_name="bar"),
         base.Image(remote_path="zoo", remote_name="dee"),
     ]
     process_entity_comment(self.comment, ProfileFactory())
     content = Content.objects.get(guid=self.comment.guid, parent=self.content)
     self.assertEqual(content.text.index("![](foobar) ![](zoodee) \n\n%s" % self.comment.raw_content), 0)
示例#2
0
 def test_entity_images_are_prefixed_to_post_text(self):
     entity = entities.PostFactory(_children=[
         base.Image(remote_path="foo", remote_name="bar"),
         base.Image(remote_path="zoo", remote_name="dee"),
     ], )
     process_entity_post(entity, ProfileFactory())
     content = Content.objects.get(guid=entity.guid)
     assert content.text.index("![](foobar) ![](zoodee) \n\n%s" %
                               entity.raw_content) == 0