diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2009-04-07 19:49:07 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2009-04-07 19:49:07 +0000 |
| commit | 6319470f88d464204c0f62622cc3f8ff081bce0f (patch) | |
| tree | 6b8574b257a3c797a85421f9305f2203c567be9c /tests/regressiontests/comment_tests | |
| parent | eef2c5f6dea6ad06f064d46292d2f21ebebaf839 (diff) | |
Fixed #10585: comment redirects built from the `next` parameter now work correctly when `next` already contains a query string.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10424 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/comment_tests')
| -rw-r--r-- | tests/regressiontests/comment_tests/tests/comment_view_tests.py | 13 |
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 312fab633f..192131bf0c 100644 --- a/tests/regressiontests/comment_tests/tests/comment_view_tests.py +++ b/tests/regressiontests/comment_tests/tests/comment_view_tests.py @@ -207,3 +207,16 @@ class CommentViewTests(CommentTestCase): self.assertTemplateUsed(response, "comments/posted.html") self.assertEqual(response.context[0]["comment"], Comment.objects.get(pk=pk)) + 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 |
