2016-09-20 22:51:11 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
2016-11-10 19:30:09 +01:00
|
|
|
from zerver.lib.test_classes import WebhookTestCase
|
2016-09-20 22:51:11 +02:00
|
|
|
|
|
|
|
class IFTTTHookTests(WebhookTestCase):
|
|
|
|
STREAM_NAME = 'ifttt'
|
|
|
|
URL_TEMPLATE = "/api/v1/external/ifttt?stream={stream}&api_key={api_key}"
|
|
|
|
FIXTURE_DIR_NAME = 'ifttt'
|
|
|
|
|
2017-11-04 07:47:46 +01:00
|
|
|
def test_ifttt_when_subject_and_body_are_correct(self) -> None:
|
2016-09-20 22:51:11 +02:00
|
|
|
expected_subject = u"Email sent from email@email.com"
|
|
|
|
expected_message = u"Email subject: Subject"
|
|
|
|
self.send_and_test_stream_message('correct_subject_and_body', expected_subject, expected_message)
|
2018-03-17 21:11:54 +01:00
|
|
|
|
|
|
|
def test_ifttt_when_topic_and_body_are_correct(self) -> None:
|
|
|
|
expected_subject = u"Email sent from email@email.com"
|
|
|
|
expected_message = u"Email subject: Subject"
|
|
|
|
self.send_and_test_stream_message('correct_topic_and_body', expected_subject, expected_message)
|