Skip to content

Commit 3099210

Browse files
committed
Add simple render_comment_list test
1 parent 151fd2a commit 3099210

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

threadedcomments/tests.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from django.conf import settings
44
from django.contrib.sites.models import Site
5+
from django.template import Context
6+
from django.template import Template
57
from django.template import TemplateSyntaxError, loader
68
from django.test import TransactionTestCase
79
from threadedcomments.templatetags import threadedcomments_tags as tags
@@ -214,6 +216,11 @@ def test_last_child_repointed_correctly_on_delete(self):
214216
comment = Comment.objects.get(pk=1)
215217
self.assertEqual(last_child, comment.last_child)
216218

219+
def test_render_comment_list(self):
220+
template = Template('{% load threadedcomments_tags %}{% render_comment_list for sites.site 1 %}')
221+
html = sanitize_html(template.render(Context()))
222+
self.assertIn('Comment 7', html)
223+
217224

218225
# Templatetags tests
219226
##############################################################################

0 commit comments

Comments
 (0)