Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
from zerver.lib.test_classes import WebhookTestCase
class DelightedHookTests(WebhookTestCase):
def test_feedback_message_promoter(self) -> None:
expected_topic_name = "Survey response"
expected_message = """
Kudos! You have a new promoter. Score of 9/10 from [email protected]:
``` quote
Your service is fast and flawless!
```
""".strip()
self.check_webhook(
"survey_response_updated_promoter",
expected_topic_name,
expected_message,
content_type="application/x-www-form-urlencoded",
)
def test_feedback_message_non_promoter(self) -> None:
expected_topic_name = "Survey response"
expected_message = (
"Great! You have new feedback.\n"
">Score of 5/10 from [email protected]"
"\n>Your service is slow, but nearly flawless! "
"Keep up the good work!"
)
expected_message = """
Great! You have new feedback. Score of 5/10 from [email protected]:
``` quote
Your service is slow, but nearly flawless! Keep up the good work!
```
""".strip()
self.check_webhook(
"survey_response_updated_non_promoter",
expected_topic_name,
expected_message,
content_type="application/x-www-form-urlencoded",
)