              "No object matching content-type %r and object PK %r exists." % \
                  (escape(ctype), escape(object_pk)))
  
      # Do we want to preview the comment?
      preview = "preview" in data
  
 
</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     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
    except (ValueError, ValidationError), e:
        return CommentPostBadRequest(
            "Attempting go get content-type %r and object PK %r exists raised %s" % \
                (escape(ctype), escape(object_pk), e.__class__.__name__))
              "No object matching content-type %r and object PK %r exists." % \
                  (escape(ctype), escape(object_pk)))
    except (ValueError, ValidationError), e:
        return CommentPostBadRequest(
            "Attempting go get content-type %r and object PK %r exists raised %s" % \
                (escape(ctype), escape(object_pk), e.__class__.__name__))
  
      # Do we want to preview the comment?
      preview = "preview" in data
  
keep add 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 
django/contrib/comments/views/comments.py