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.

24 lines
696 B

  1. import json
  2. from hc.api.models import Channel
  3. from hc.test import BaseTestCase
  4. class ChannelsTestCase(BaseTestCase):
  5. def test_it_formats_complex_slack_value(self):
  6. ch = Channel(kind="slack", user=self.alice)
  7. ch.value = json.dumps({
  8. "ok": True,
  9. "team_name": "foo-team",
  10. "incoming_webhook": {
  11. "url": "http://example.org",
  12. "channel": "#bar"
  13. }
  14. })
  15. ch.save()
  16. self.client.login(username="[email protected]", password="password")
  17. r = self.client.get("/integrations/")
  18. self.assertContains(r, "foo-team", status_code=200)
  19. self.assertContains(r, "#bar")