mirror of
https://github.com/zulip/zulip.git
synced 2025-11-08 07:52:19 +00:00
This is preparatory work towards adding a Topic model. We plan to use the local variable name as 'topic' for the Topic model objects. Currently, we use *topic as the local variable name for topic names. We rename local variables of the form *topic to *topic_name so that we don't need to think about type collisions in individual code paths where we might want to talk about both Topic objects and strings for the topic name.
32 lines
1.2 KiB
Python
32 lines
1.2 KiB
Python
from zerver.lib.test_classes import WebhookTestCase
|
|
|
|
|
|
class OpenCollectiveHookTests(WebhookTestCase):
|
|
STREAM_NAME = "test"
|
|
URL_TEMPLATE = "/api/v1/external/opencollective?&api_key={api_key}&stream={stream}"
|
|
WEBHOOK_DIR_NAME = "opencollective"
|
|
|
|
# Note: Include a test function per each distinct message condition your integration supports
|
|
def test_one_time_donation(self) -> None: # test one time donation
|
|
expected_topic_name = "New Member"
|
|
expected_message = "@_**Λευτέρης Κυριαζάνος** donated **€1.00**! :tada:"
|
|
|
|
self.check_webhook(
|
|
"one_time_donation",
|
|
expected_topic_name,
|
|
expected_message,
|
|
content_type="application/x-www-form-urlencoded",
|
|
)
|
|
|
|
def test_one_time_incognito_donation(self) -> None: # test one time incognito donation
|
|
expected_topic_name = "New Member"
|
|
expected_message = "An **Incognito** member donated **$1.00**! :tada:"
|
|
|
|
# use fixture named helloworld_hello
|
|
self.check_webhook(
|
|
"one_time_incognito_donation",
|
|
expected_topic_name,
|
|
expected_message,
|
|
content_type="application/x-www-form-urlencoded",
|
|
)
|