Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

trello tests: Test that we ignore "pos" data.

Steve Howell43cc4a2c5081
diff --git a/zerver/webhooks/trello/tests.py b/zerver/webhooks/trello/tests.py
index f94c09c4081..75f6aadca23 100644
--- a/zerver/webhooks/trello/tests.py
+++ b/zerver/webhooks/trello/tests.py
@@ -1,3 +1,4 @@
+from typing import Dict
from unittest.mock import patch
import orjson
@@ -133,6 +134,27 @@ class TrelloHookTests(WebhookTestCase):
payload = orjson.dumps(data).decode()
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:
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)