          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.
          """
          a = Article.objects.get(pk=1)
          data = self.getValidData(a)
          data["comment"] = "This is another comment"
 
</s> remove     def testCommentDoneReSubmitWithInvalidParams(self):
 </s> add     def testCommentPostRedirectWithInvalidIntegerPK(self): </s> remove from regressiontests.comment_tests.models import Article
 </s> add from regressiontests.comment_tests.models import Article, Book
        Tests that attempting to retrieve the location specified in the
        post redirect, after adding some invalid data to the expected
          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
        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"
keep keep keep keep replace 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