Skip to content
This repository has been archived by the owner on Jan 7, 2021. It is now read-only.

Commit

Permalink
Removed unneeded self references
Browse files Browse the repository at this point in the history
  • Loading branch information
claudep committed Jun 16, 2017
1 parent cb50604 commit 8112496
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/testapp/tests/test_comment_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ def testCreateValidComment(self):
address = "1.2.3.4"
a = Article.objects.get(pk=1)
data = self.getValidData(a)
self.response = self.client.post("/post/", data, REMOTE_ADDR=address)
self.assertEqual(self.response.status_code, 302)
response = self.client.post("/post/", data, REMOTE_ADDR=address)
self.assertEqual(response.status_code, 302)
self.assertEqual(Comment.objects.count(), 1)
c = Comment.objects.all()[0]
self.assertEqual(c.ip_address, address)
Expand All @@ -133,8 +133,8 @@ def testCreateValidCommentIPv6(self):
address = "2a02::223:6cff:fe8a:2e8a"
a = Article.objects.get(pk=1)
data = self.getValidData(a)
self.response = self.client.post("/post/", data, REMOTE_ADDR=address)
self.assertEqual(self.response.status_code, 302)
response = self.client.post("/post/", data, REMOTE_ADDR=address)
self.assertEqual(response.status_code, 302)
self.assertEqual(Comment.objects.count(), 1)
c = Comment.objects.all()[0]
self.assertEqual(c.ip_address, address)
Expand All @@ -153,8 +153,8 @@ def testCreateValidCommentIPv6Unpack(self):
address = "::ffff:18.52.18.52"
a = Article.objects.get(pk=1)
data = self.getValidData(a)
self.response = self.client.post("/post/", data, REMOTE_ADDR=address)
self.assertEqual(self.response.status_code, 302)
response = self.client.post("/post/", data, REMOTE_ADDR=address)
self.assertEqual(response.status_code, 302)
self.assertEqual(Comment.objects.count(), 1)
c = Comment.objects.all()[0]
# We trim the '::ffff:' bit off because it is an IPv4 addr
Expand All @@ -166,8 +166,8 @@ def testPostAsAuthenticatedUser(self):
data = self.getValidData(a)
data['name'] = data['email'] = ''
self.client.login(username="normaluser", password="normaluser")
self.response = self.client.post("/post/", data, REMOTE_ADDR="1.2.3.4")
self.assertEqual(self.response.status_code, 302)
response = self.client.post("/post/", data, REMOTE_ADDR="1.2.3.4")
self.assertEqual(response.status_code, 302)
self.assertEqual(Comment.objects.count(), 1)
c = Comment.objects.all()[0]
self.assertEqual(c.ip_address, "1.2.3.4")
Expand All @@ -187,7 +187,7 @@ def testPostAsAuthenticatedUserWithoutFullname(self):
data = self.getValidData(a)
data['name'] = data['email'] = ''
self.client.login(username="jane_other", password="jane_other")
self.response = self.client.post("/post/", data, REMOTE_ADDR="1.2.3.4")
self.client.post("/post/", data, REMOTE_ADDR="1.2.3.4")
c = Comment.objects.get(user=user)
self.assertEqual(c.ip_address, "1.2.3.4")
self.assertEqual(c.user_name, 'jane_other')
Expand Down

0 comments on commit 8112496

Please sign in to comment.