Browse Source

Fix tests after renaming /channels/ to /integrations/

pull/7/head
Pēteris Caune 9 years ago
parent
commit
61297c417d
5 changed files with 17 additions and 17 deletions
  1. +2
    -2
      hc/front/tests/test_add_channel.py
  2. +3
    -3
      hc/front/tests/test_channel_checks.py
  3. +4
    -4
      hc/front/tests/test_remove_channel.py
  4. +5
    -5
      hc/front/tests/test_update_channel.py
  5. +3
    -3
      hc/front/tests/test_verify_email.py

+ 2
- 2
hc/front/tests/test_add_channel.py View File

@ -12,7 +12,7 @@ class AddChannelTestCase(TestCase):
self.alice.save()
def test_it_works(self):
url = "/channels/add/"
url = "/integrations/add/"
form = {"kind": "email", "value": "[email protected]"}
self.client.login(username="alice", password="password")
@ -22,7 +22,7 @@ class AddChannelTestCase(TestCase):
assert Channel.objects.count() == 1
def test_it_rejects_bad_kind(self):
url = "/channels/add/"
url = "/integrations/add/"
form = {"kind": "dog", "value": "Lassie"}
self.client.login(username="alice", password="password")


+ 3
- 3
hc/front/tests/test_channel_checks.py View File

@ -16,7 +16,7 @@ class ChannelChecksTestCase(TestCase):
self.channel.save()
def test_it_works(self):
url = "/channels/%s/checks/" % self.channel.code
url = "/integrations/%s/checks/" % self.channel.code
self.client.login(username="alice", password="password")
r = self.client.get(url)
@ -29,14 +29,14 @@ class ChannelChecksTestCase(TestCase):
# channel does not belong to mallory so this should come back
# with 403 Forbidden:
url = "/channels/%s/checks/" % self.channel.code
url = "/integrations/%s/checks/" % self.channel.code
self.client.login(username="mallory", password="password")
r = self.client.get(url)
assert r.status_code == 403
def test_missing_channel(self):
# Valid UUID but there is no channel for it:
url = "/channels/6837d6ec-fc08-4da5-a67f-08a9ed1ccf62/checks/"
url = "/integrations/6837d6ec-fc08-4da5-a67f-08a9ed1ccf62/checks/"
self.client.login(username="alice", password="password")
r = self.client.get(url)


+ 4
- 4
hc/front/tests/test_remove_channel.py View File

@ -16,7 +16,7 @@ class RemoveChannelTestCase(TestCase):
self.channel.save()
def test_it_works(self):
url = "/channels/%s/remove/" % self.channel.code
url = "/integrations/%s/remove/" % self.channel.code
self.client.login(username="alice", password="password")
r = self.client.post(url)
@ -25,14 +25,14 @@ class RemoveChannelTestCase(TestCase):
assert Channel.objects.count() == 0
def test_it_handles_bad_uuid(self):
url = "/channels/not-uuid/remove/"
url = "/integrations/not-uuid/remove/"
self.client.login(username="alice", password="password")
r = self.client.post(url)
assert r.status_code == 400
def test_it_checks_owner(self):
url = "/channels/%s/remove/" % self.channel.code
url = "/integrations/%s/remove/" % self.channel.code
mallory = User(username="mallory")
mallory.set_password("password")
@ -44,7 +44,7 @@ class RemoveChannelTestCase(TestCase):
def test_it_handles_missing_uuid(self):
# Valid UUID but there is no channel for it:
url = "/channels/6837d6ec-fc08-4da5-a67f-08a9ed1ccf62/remove/"
url = "/integrations/6837d6ec-fc08-4da5-a67f-08a9ed1ccf62/remove/"
self.client.login(username="alice", password="password")
r = self.client.post(url)


+ 5
- 5
hc/front/tests/test_update_channel.py View File

@ -25,7 +25,7 @@ class UpdateChannelTestCase(TestCase):
}
self.client.login(username="alice", password="password")
r = self.client.post("/channels/", data=payload)
r = self.client.post("/integrations/", data=payload)
assert r.status_code == 302
channel = Channel.objects.get(code=self.channel.code)
@ -41,7 +41,7 @@ class UpdateChannelTestCase(TestCase):
payload = {"channel": self.channel.code}
self.client.login(username="mallory", password="password")
r = self.client.post("/channels/", data=payload)
r = self.client.post("/integrations/", data=payload)
# self.channel does not belong to mallory, this should fail--
assert r.status_code == 403
@ -60,7 +60,7 @@ class UpdateChannelTestCase(TestCase):
"check-%s" % self.check.code: True
}
self.client.login(username="mallory", password="password")
r = self.client.post("/channels/", data=payload)
r = self.client.post("/integrations/", data=payload)
# mc belongs to mallorym but self.check does not--
assert r.status_code == 403
@ -70,7 +70,7 @@ class UpdateChannelTestCase(TestCase):
payload = {"channel": "6837d6ec-fc08-4da5-a67f-08a9ed1ccf62"}
self.client.login(username="alice", password="password")
r = self.client.post("/channels/", data=payload)
r = self.client.post("/integrations/", data=payload)
assert r.status_code == 400
def test_it_handles_missing_check(self):
@ -81,5 +81,5 @@ class UpdateChannelTestCase(TestCase):
}
self.client.login(username="alice", password="password")
r = self.client.post("/channels/", data=payload)
r = self.client.post("/integrations/", data=payload)
assert r.status_code == 400

+ 3
- 3
hc/front/tests/test_verify_email.py View File

@ -17,7 +17,7 @@ class VerifyEmailTestCase(TestCase):
def test_it_works(self):
token = self.channel.make_token()
url = "/channels/%s/verify/%s/" % (self.channel.code, token)
url = "/integrations/%s/verify/%s/" % (self.channel.code, token)
r = self.client.post(url)
assert r.status_code == 200, r.status_code
@ -26,7 +26,7 @@ class VerifyEmailTestCase(TestCase):
assert channel.email_verified
def test_it_handles_bad_token(self):
url = "/channels/%s/verify/bad-token/" % self.channel.code
url = "/integrations/%s/verify/bad-token/" % self.channel.code
r = self.client.post(url)
assert r.status_code == 200, r.status_code
@ -38,7 +38,7 @@ class VerifyEmailTestCase(TestCase):
# Valid UUID, and even valid token but there is no channel for it:
code = "6837d6ec-fc08-4da5-a67f-08a9ed1ccf62"
token = self.channel.make_token()
url = "/channels/%s/verify/%s/" % (code, token)
url = "/integrations/%s/verify/%s/" % (code, token)
r = self.client.post(url)
assert r.status_code == 404

Loading…
Cancel
Save