          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)
  
      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.
          """
 
</s> remove         Tests that attempting to retrieve the location specified in the 
        post redirect, after adding some invalid data to the expected 
 </s> add         Tests that attempting to retrieve the location specified in the
        post redirect, after adding some invalid data to the expected </s> remove from regressiontests.comment_tests.models import Article
 </s> add from regressiontests.comment_tests.models import Article, Book
    def testCommentPostRedirectWithInvalidIntegerPK(self):
          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)
  
    def testCommentPostRedirectWithInvalidIntegerPK(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.
          """
keep keep keep keep replace keep keep keep keep keep
 Changed the comments post view code to avoid raising an exception if handed invalid data for the object pk. Thanks to Leo for the test.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@12800 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
tests/regressiontests/comment_tests/tests/comment_view_tests.py