|
@ -3,7 +3,9 @@ from hc.test import BaseTestCase |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AddSpikeTestCase(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): |
|
|
def test_instructions_work(self): |
|
|
self.client.login(username="[email protected]", password="password") |
|
|
self.client.login(username="[email protected]", password="password") |
|
@ -15,7 +17,7 @@ class AddSpikeTestCase(BaseTestCase): |
|
|
|
|
|
|
|
|
self.client.login(username="[email protected]", password="password") |
|
|
self.client.login(username="[email protected]", password="password") |
|
|
r = self.client.post(self.url, form) |
|
|
r = self.client.post(self.url, form) |
|
|
self.assertRedirects(r, "/integrations/") |
|
|
|
|
|
|
|
|
self.assertRedirects(r, self.channels_url) |
|
|
|
|
|
|
|
|
c = Channel.objects.get() |
|
|
c = Channel.objects.get() |
|
|
self.assertEqual(c.kind, "spike") |
|
|
self.assertEqual(c.kind, "spike") |
|
@ -27,4 +29,4 @@ class AddSpikeTestCase(BaseTestCase): |
|
|
|
|
|
|
|
|
self.client.login(username="[email protected]", password="password") |
|
|
self.client.login(username="[email protected]", password="password") |
|
|
r = self.client.post(self.url, form) |
|
|
r = self.client.post(self.url, form) |
|
|
self.assertContains(r, "Enter a valid URL") |
|
|
|
|
|
|
|
|
self.assertContains(r, "Enter a valid URL") |