

def testGetCommentPermalinkFormatted(self):
    (c1, c2, c3, c4) = self.createSomeComments()
    t = '{% load comments %}{% get_comment_list for testapp.author author.id as cl %}'
    t += "{% get_comment_permalink cl.0 '#c%(id)s-by-%(user_name)s' %}"
    ct = ContentType.objects.get_for_model(Author)
    author = Author.objects.get(pk=1)
    (ctx, out) = self.render(t, author=author)
    self.assertEqual(out, ('/cr/%s/%s/#c%s-by-Joe Somebody' % (ct.id, author.id, c2.id)))

dataset/ETHPy150Open django/django-contrib-comments/tests/testapp/tests/test_templatetags.py CommentTemplateTagTests.testGetCommentPermalinkFormatted/original