mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 06:53:25 +00:00
Since FIXTURE_DIR_NAME is the name of the folder that contains the view and tests modules of the webhook and another folder called "fixtures" that store the fixtures, it is more appropriate to call it WEBHOOK_DIR_NAME, especially when we want to refer to the view module using this variable.
24 lines
782 B
Python
24 lines
782 B
Python
from zerver.lib.test_classes import WebhookTestCase
|
|
|
|
|
|
class JotFormHookTests(WebhookTestCase):
|
|
STREAM_NAME = "test"
|
|
URL_TEMPLATE = "/api/v1/external/jotform?stream={stream}&api_key={api_key}"
|
|
WEBHOOK_DIR_NAME = "jotform"
|
|
|
|
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",
|
|
)
|