  from django.conf import settings
  from django.contrib.auth.models import User
  from django.contrib.comments import signals
  from django.contrib.comments.models import Comment
  from regressiontests.comment_tests.models import Article
  from regressiontests.comment_tests.tests import CommentTestCase
  
  post_redirect_re = re.compile(r'^http://testserver/posted/\?c=(?P<pk>\d+$)')
  
  class CommentViewTests(CommentTestCase):
 
</s> remove from django.core.exceptions import ObjectDoesNotExist
 </s> add from django.core.exceptions import ObjectDoesNotExist, ValidationError </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):
from regressiontests.comment_tests.models import Article, Book
  from django.conf import settings
  from django.contrib.auth.models import User
  from django.contrib.comments import signals
  from django.contrib.comments.models import Comment
from regressiontests.comment_tests.models import Article, Book
  from regressiontests.comment_tests.tests import CommentTestCase
  
  post_redirect_re = re.compile(r'^http://testserver/posted/\?c=(?P<pk>\d+$)')
  
  class CommentViewTests(CommentTestCase):
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