diff --git a/hc/front/tests/test_add_pdc.py b/hc/front/tests/test_add_pdc.py
index 3480da36..0e19c761 100644
--- a/hc/front/tests/test_add_pdc.py
+++ b/hc/front/tests/test_add_pdc.py
@@ -9,11 +9,6 @@ class AddPdConnectTestCase(BaseTestCase):
super(AddPdConnectTestCase, self).setUp()
self.url = "/projects/%s/add_pdc/" % self.project.code
- def test_instructions_work(self):
- self.client.login(username="alice@example.org", password="password")
- r = self.client.get(self.url)
- self.assertContains(r, "If your team uses")
-
def test_it_works(self):
session = self.client.session
session["pd"] = "1234567890AB" # 12 characters
@@ -29,17 +24,9 @@ class AddPdConnectTestCase(BaseTestCase):
self.assertEqual(c.pd_service_key, "123")
self.assertEqual(c.project, self.project)
- def test_it_validates_code(self):
- session = self.client.session
- session["pd"] = "1234567890AB"
- session.save()
-
- self.client.login(username="alice@example.org", password="password")
- url = self.url + "XXXXXXXXXXXX/?service_key=123"
- r = self.client.get(url)
- self.assertEqual(r.status_code, 400)
-
@override_settings(PD_VENDOR_KEY=None)
def test_it_requires_vendor_key(self):
+ self.client.login(username="alice@example.org", password="password")
+
r = self.client.get(self.url)
self.assertEqual(r.status_code, 404)
diff --git a/hc/front/tests/test_add_pdc_complete.py b/hc/front/tests/test_add_pdc_complete.py
new file mode 100644
index 00000000..fffc40ab
--- /dev/null
+++ b/hc/front/tests/test_add_pdc_complete.py
@@ -0,0 +1,26 @@
+from django.test.utils import override_settings
+from hc.test import BaseTestCase
+
+
+@override_settings(PD_VENDOR_KEY="foo")
+class AddPdcCompleteTestCase(BaseTestCase):
+ def setUp(self):
+ super(AddPdcCompleteTestCase, self).setUp()
+ self.url = "/projects/%s/add_pdc/" % self.project.code
+ self.url += "XXXXXXXXXXXX/?service_key=123"
+
+ def test_it_validates_code(self):
+ session = self.client.session
+ session["pd"] = "1234567890AB"
+ session.save()
+
+ self.client.login(username="alice@example.org", password="password")
+ r = self.client.get(self.url)
+ self.assertEqual(r.status_code, 400)
+
+ @override_settings(PD_VENDOR_KEY=None)
+ def test_it_requires_vendor_key(self):
+ self.client.login(username="alice@example.org", password="password")
+
+ r = self.client.get(self.url)
+ self.assertEqual(r.status_code, 404)
diff --git a/hc/front/tests/test_add_pdc_help.py b/hc/front/tests/test_add_pdc_help.py
new file mode 100644
index 00000000..9ac98975
--- /dev/null
+++ b/hc/front/tests/test_add_pdc_help.py
@@ -0,0 +1,21 @@
+from django.test.utils import override_settings
+from hc.test import BaseTestCase
+
+
+@override_settings(PD_VENDOR_KEY="foo")
+class AddPdcHelpTestCase(BaseTestCase):
+ url = "/integrations/add_pdc/"
+
+ def test_instructions_work_when_not_logged_in(self):
+ r = self.client.get(self.url)
+ self.assertContains(r, "Before adding PagerDuty integration, please log")
+
+ def test_instructions_work(self):
+ self.client.login(username="alice@example.org", password="password")
+ r = self.client.get(self.url)
+ self.assertContains(r, "If your team uses")
+
+ @override_settings(PD_VENDOR_KEY=None)
+ def test_it_requires_vendor_key(self):
+ r = self.client.get(self.url)
+ self.assertEqual(r.status_code, 404)
diff --git a/hc/front/urls.py b/hc/front/urls.py
index c1970f10..6cd7e229 100644
--- a/hc/front/urls.py
+++ b/hc/front/urls.py
@@ -31,6 +31,7 @@ channel_urls = [
path("add_discord/", views.add_discord_complete, name="hc-add-discord-complete"),
path("add_pushover/", views.add_pushover_help),
path("telegram/bot/", views.telegram_bot, name="hc-telegram-webhook"),
+ path("add_pdc/", views.add_pdc_help),
path("add_slack/", views.add_slack_help),
path("add_slack_btn/", views.add_slack_complete),
path("add_telegram/", views.add_telegram, name="hc-add-telegram"),
@@ -61,7 +62,7 @@ project_urls = [
path("add_pagertree/", views.add_pagertree, name="hc-add-pagertree"),
path("add_pd/", views.add_pd, name="hc-add-pd"),
path("add_pdc/", views.add_pdc, name="hc-add-pdc"),
- path("add_pdc/