summaryrefslogtreecommitdiff
path: root/tests/regressiontests/comment_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/regressiontests/comment_tests')
-rw-r--r--tests/regressiontests/comment_tests/tests/comment_view_tests.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/regressiontests/comment_tests/tests/comment_view_tests.py b/tests/regressiontests/comment_tests/tests/comment_view_tests.py
index 192131bf0c..f33a752843 100644
--- a/tests/regressiontests/comment_tests/tests/comment_view_tests.py
+++ b/tests/regressiontests/comment_tests/tests/comment_view_tests.py
@@ -219,4 +219,18 @@ class CommentViewTests(CommentTestCase):
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
+
+ def testCommentDoneReSubmitWithInvalidParams(self):
+ """
+ Tests that attempting to retrieve the location specified in the
+ post redirect, after adding some invalid data to the expected
+ querystring it ends with, doesn't cause a server error.
+ """
+ a = Article.objects.get(pk=1)
+ data = self.getValidData(a)
+ data["comment"] = "This is another comment"
+ response = self.client.post("/post/", data)
+ location = response["Location"]
+ broken_location = location + u"\ufffd"
+ response = self.client.get(broken_location)
+ self.assertEqual(response.status_code, 200)