summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2009-04-07 19:50:42 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2009-04-07 19:50:42 +0000
commit0c85192ebeb374e7a7ad8e72ebecdf173d7fdcce (patch)
treef3f94a9f4977c2e399bb306d3c4656898da35fba /tests
parentf78c70b3b21cb28ce77b674706bb64b297ab0649 (diff)
[1.0.X] Fixed #10585: comment redirects built from the `next` parameter now work correctly when `next` already contains a query string. Backport of r10424 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10425 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/comment_tests/tests/comment_view_tests.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/regressiontests/comment_tests/tests/comment_view_tests.py b/tests/regressiontests/comment_tests/tests/comment_view_tests.py
index 0c975116ef..9183888d5c 100644
--- a/tests/regressiontests/comment_tests/tests/comment_view_tests.py
+++ b/tests/regressiontests/comment_tests/tests/comment_view_tests.py
@@ -196,3 +196,16 @@ class CommentViewTests(CommentTestCase):
self.assertTemplateUsed(response, "comments/posted.html")
self.assertEqual(response.context[0]["comment"], Comment.objects.get(pk=1))
+ def testCommentNextWithQueryString(self):
+ """
+ The `next` key needs to handle already having a query string (#10585)
+ """
+ a = Article.objects.get(pk=1)
+ data = self.getValidData(a)
+ data["next"] = "/somewhere/else/?foo=bar"
+ data["comment"] = "This is another comment"
+ response = self.client.post("/post/", data)
+ location = response["Location"]
+ match = re.search(r"^http://testserver/somewhere/else/\?foo=bar&c=\d+$", location)
+ self.failUnless(match != None, "Unexpected redirect location: %s" % location)
+ \ No newline at end of file