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:
Steve Howell
2020-08-21 11:59:11 +00:00
committed by Tim Abbott
parent bfe04ff6cf
commit 43cc4a2c50

View File

@@ -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)