summaryrefslogtreecommitdiff
path: root/tests/comment_tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2013-10-10 09:35:56 -0400
committerTim Graham <timograham@gmail.com>2013-10-10 09:35:56 -0400
commitcec11a3336c730e6dc2f1966fee749cc830e97c0 (patch)
tree014c34809c0d39ca63c711e6168d297b9de013b3 /tests/comment_tests
parentff9e8eccf89fc1dce441736c39dcb6e218ca8940 (diff)
Used "is" for comparisons with None.
Diffstat (limited to 'tests/comment_tests')
-rw-r--r--tests/comment_tests/tests/test_comment_view.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/comment_tests/tests/test_comment_view.py b/tests/comment_tests/tests/test_comment_view.py
index 19d7c1d16b..731776a1e2 100644
--- a/tests/comment_tests/tests/test_comment_view.py
+++ b/tests/comment_tests/tests/test_comment_view.py
@@ -243,21 +243,21 @@ class CommentViewTests(CommentTestCase):
response = self.client.post("/post/", data)
location = response["Location"]
match = post_redirect_re.match(location)
- self.assertTrue(match != None, "Unexpected redirect location: %s" % location)
+ self.assertTrue(match is not None, "Unexpected redirect location: %s" % location)
data["next"] = "/somewhere/else/"
data["comment"] = "This is another comment"
response = self.client.post("/post/", data)
location = response["Location"]
match = re.search(r"^http://testserver/somewhere/else/\?c=\d+$", location)
- self.assertTrue(match != None, "Unexpected redirect location: %s" % location)
+ self.assertTrue(match is not None, "Unexpected redirect location: %s" % location)
data["next"] = "http://badserver/somewhere/else/"
data["comment"] = "This is another comment with an unsafe next url"
response = self.client.post("/post/", data)
location = response["Location"]
match = post_redirect_re.match(location)
- self.assertTrue(match != None, "Unsafe redirection to: %s" % location)
+ self.assertTrue(match is not None, "Unsafe redirection to: %s" % location)
def testCommentDoneView(self):
a = Article.objects.get(pk=1)
@@ -265,7 +265,7 @@ class CommentViewTests(CommentTestCase):
response = self.client.post("/post/", data)
location = response["Location"]
match = post_redirect_re.match(location)
- self.assertTrue(match != None, "Unexpected redirect location: %s" % location)
+ self.assertTrue(match is not None, "Unexpected redirect location: %s" % location)
pk = int(match.group('pk'))
response = self.client.get(location)
self.assertTemplateUsed(response, "comments/posted.html")
@@ -282,7 +282,7 @@ class CommentViewTests(CommentTestCase):
response = self.client.post("/post/", data)
location = response["Location"]
match = re.search(r"^http://testserver/somewhere/else/\?foo=bar&c=\d+$", location)
- self.assertTrue(match != None, "Unexpected redirect location: %s" % location)
+ self.assertTrue(match is not None, "Unexpected redirect location: %s" % location)
def testCommentPostRedirectWithInvalidIntegerPK(self):
"""
@@ -311,7 +311,7 @@ class CommentViewTests(CommentTestCase):
response = self.client.post("/post/", data)
location = response["Location"]
match = re.search(r"^http://testserver/somewhere/else/\?foo=bar&c=\d+#baz$", location)
- self.assertTrue(match != None, "Unexpected redirect location: %s" % location)
+ self.assertTrue(match is not None, "Unexpected redirect location: %s" % location)
# Without a query string
a = Article.objects.get(pk=1)
@@ -321,4 +321,4 @@ class CommentViewTests(CommentTestCase):
response = self.client.post("/post/", data)
location = response["Location"]
match = re.search(r"^http://testserver/somewhere/else/\?c=\d+#baz$", location)
- self.assertTrue(match != None, "Unexpected redirect location: %s" % location)
+ self.assertTrue(match is not None, "Unexpected redirect location: %s" % location)