You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

22 lines
867 B

from django.test.utils import override_settings
from hc.test import BaseTestCase
@override_settings(SLACK_CLIENT_ID="fake-client-id")
class AddSlackBtnTestCase(BaseTestCase):
def setUp(self):
super(AddSlackBtnTestCase, self).setUp()
self.url = "/projects/%s/add_slack_btn/" % self.project.code
def test_instructions_work(self):
self.client.login(username="[email protected]", password="password")
r = self.client.get(self.url)
self.assertContains(r, "Setup Guide", status_code=200)
def test_slack_button(self):
self.client.login(username="[email protected]", password="password")
r = self.client.get(self.url)
self.assertContains(r, "slack.com/oauth/authorize", status_code=200)
# There should now be a key in session
self.assertTrue("add_slack" in self.client.session)