mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 10:57:58 +00:00
trello tests: Test that we ignore "pos" data.
We will extend this test soon, once we begin ignoring other fields.
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
from typing import Dict
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
import orjson
|
import orjson
|
||||||
@@ -133,6 +134,27 @@ class TrelloHookTests(WebhookTestCase):
|
|||||||
payload = orjson.dumps(data).decode()
|
payload = orjson.dumps(data).decode()
|
||||||
self.verify_post_is_ignored(payload)
|
self.verify_post_is_ignored(payload)
|
||||||
|
|
||||||
|
def test_ignoring_card_updates(self) -> None:
|
||||||
|
fields = [
|
||||||
|
"pos",
|
||||||
|
]
|
||||||
|
for field in fields:
|
||||||
|
card: Dict[str, object] = {}
|
||||||
|
old = {}
|
||||||
|
old[field] = "should-be-ignored"
|
||||||
|
data = dict(
|
||||||
|
model="whatever",
|
||||||
|
action=dict(
|
||||||
|
type="updateCard",
|
||||||
|
data=dict(
|
||||||
|
card=card,
|
||||||
|
old=old
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
payload = orjson.dumps(data).decode()
|
||||||
|
self.verify_post_is_ignored(payload)
|
||||||
|
|
||||||
def test_trello_webhook_when_description_was_added_to_card(self) -> None:
|
def test_trello_webhook_when_description_was_added_to_card(self) -> None:
|
||||||
expected_message = "Marco Matarazzo set description for [New Card](https://trello.com/c/P2r0z66z) to:\n~~~ quote\nNew Description\n~~~"
|
expected_message = "Marco Matarazzo set description for [New Card](https://trello.com/c/P2r0z66z) to:\n~~~ quote\nNew Description\n~~~"
|
||||||
self.check_webhook("adding_description_to_card", "Welcome Board", expected_message)
|
self.check_webhook("adding_description_to_card", "Welcome Board", expected_message)
|
||||||
|
|||||||
Reference in New Issue
Block a user