Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #12724: Fixed new comment tests to not hardcode comment primary…

… key values. Thanks carljm.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12345 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 59cccd1474ca8ac4f691685372a607277534fa8e 1 parent e808fc8
Karen Tracey authored January 28, 2010
8  tests/regressiontests/comment_tests/tests/templatetag_tests.py
@@ -66,22 +66,22 @@ def testGetCommentListFromObject(self):
66 66
         self.testGetCommentList("{% get_comment_list for a as cl %}")
67 67
 
68 68
     def testGetCommentPermalink(self):
69  
-        self.createSomeComments()
  69
+        c1, c2, c3, c4 = self.createSomeComments()
70 70
         t = "{% load comments %}{% get_comment_list for comment_tests.author author.id as cl %}"
71 71
         t += "{% get_comment_permalink cl.0 %}"
72 72
         ct = ContentType.objects.get_for_model(Author)
73 73
         author = Author.objects.get(pk=1)
74 74
         ctx, out = self.render(t, author=author)
75  
-        self.assertEqual(out, "/cr/%s/%s/#c2" % (ct.id, author.id))
  75
+        self.assertEqual(out, "/cr/%s/%s/#c%s" % (ct.id, author.id, c2.id))
76 76
 
77 77
     def testGetCommentPermalinkFormatted(self):
78  
-        self.createSomeComments()
  78
+        c1, c2, c3, c4 = self.createSomeComments()
79 79
         t = "{% load comments %}{% get_comment_list for comment_tests.author author.id as cl %}"
80 80
         t += "{% get_comment_permalink cl.0 '#c%(id)s-by-%(user_name)s' %}"
81 81
         ct = ContentType.objects.get_for_model(Author)
82 82
         author = Author.objects.get(pk=1)
83 83
         ctx, out = self.render(t, author=author)
84  
-        self.assertEqual(out, "/cr/%s/%s/#c2-by-Joe Somebody" % (ct.id, author.id))
  84
+        self.assertEqual(out, "/cr/%s/%s/#c%s-by-Joe Somebody" % (ct.id, author.id, c2.id))
85 85
 
86 86
     def testRenderCommentList(self, tag=None):
87 87
         t = "{% load comments %}" + (tag or "{% render_comment_list for comment_tests.article a.id %}")

0 notes on commit 59cccd1

Please sign in to comment.
Something went wrong with that request. Please try again.