2020-10-21 20:56:33 +02:00
|
|
|
from zerver.lib.test_classes import WebhookTestCase
|
|
|
|
|
|
|
|
|
2021-12-16 21:24:36 +01:00
|
|
|
class JotformHookTests(WebhookTestCase):
|
2024-05-04 22:02:50 +02:00
|
|
|
CHANNEL_NAME = "test"
|
2020-10-21 20:56:33 +02:00
|
|
|
URL_TEMPLATE = "/api/v1/external/jotform?stream={stream}&api_key={api_key}"
|
2021-06-26 09:18:33 +02:00
|
|
|
WEBHOOK_DIR_NAME = "jotform"
|
2020-10-21 20:56:33 +02:00
|
|
|
|
|
|
|
def test_response(self) -> None:
|
|
|
|
expected_title = "Form"
|
|
|
|
expected_message = """
|
|
|
|
A new submission (ID 4791133489169827307) was received:
|
|
|
|
* Name:Gaurav Pandey
|
|
|
|
* Address:Lampgarden-street wolfsquare Bengaluru Karnataka 165578
|
|
|
|
* Signature:uploads/gauravguitarrocks/202944822449057/4791133489169827307/4791133489169827307_signature_4.png
|
|
|
|
""".strip()
|
|
|
|
|
|
|
|
self.check_webhook(
|
|
|
|
"response",
|
|
|
|
expected_title,
|
|
|
|
expected_message,
|
|
|
|
content_type="application/x-www-form-urlencoded",
|
|
|
|
)
|