Fix tests.

This commit is contained in:
Pēteris Caune 2020-07-09 10:48:51 +03:00
parent 6300947c77
commit 1f978ff80e
No known key found for this signature in database
GPG Key ID: E28D7679E9A9EDE2

View File

@ -3,7 +3,9 @@ from hc.test import BaseTestCase
class AddSpikeTestCase(BaseTestCase):
url = "/integrations/add_spike/"
def setUp(self):
super(AddSpikeTestCase, self).setUp()
self.url = "/projects/%s/add_spike/" % self.project.code
def test_instructions_work(self):
self.client.login(username="alice@example.org", password="password")
@ -15,7 +17,7 @@ class AddSpikeTestCase(BaseTestCase):
self.client.login(username="alice@example.org", password="password")
r = self.client.post(self.url, form)
self.assertRedirects(r, "/integrations/")
self.assertRedirects(r, self.channels_url)
c = Channel.objects.get()
self.assertEqual(c.kind, "spike")
@ -27,4 +29,4 @@ class AddSpikeTestCase(BaseTestCase):
self.client.login(username="alice@example.org", password="password")
r = self.client.post(self.url, form)
self.assertContains(r, "Enter a valid URL")
self.assertContains(r, "Enter a valid URL")