Skip to content

Commit

Permalink
Better test case for issue anymail#361
Browse files Browse the repository at this point in the history
- shortened testcase payload to minimum required
- renamed method to be more consistant with existing code
  • Loading branch information
izimobil committed Mar 5, 2024
1 parent 2d4a8f1 commit 2cf6691
Showing 1 changed file with 2 additions and 43 deletions.
45 changes: 2 additions & 43 deletions tests/test_mailgun_webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,54 +630,13 @@ def test_clicked_event(self):
self.assertEqual(event.event_type, "clicked")
self.assertEqual(event.click_url, "https://example.com/test")

def test_no_delivery_status(self):
def test_delivery_status_is_none_event(self):
raw_event = mailgun_sign_payload(
{
"signature": {
"timestamp": "1534108637",
"token": "651869375b9df3c98fc15c4889b102119add1235c38fc92824",
"signature": "...",
},
"event-data": {
"tags": [],
"timestamp": 1534108637.153125,
"storage": {
"url": "https://sw.api.mailgun.net/v3/domains/"
"example.org/messages/eyJwI...",
"key": "eyJwI...",
},
"recipient-domain": "example.com",
"id": "hTWCTD81RtiDN-...",
"campaigns": [],
"user-variables": {},
"flags": {
"is-routed": False,
"is-authenticated": True,
"is-system-test": False,
"is-test-mode": False,
},
"log-level": "info",
"envelope": {
"sending-ip": "333.123.123.200",
"sender": "[email protected]",
"transport": "smtp",
"targets": "[email protected]",
},
"message": {
"headers": {
"to": "[email protected]",
"message-id": "20180812211713.1.DF5966851B4BAA99"
"@example.org",
"from": "[email protected]",
"subject": "Testing",
},
"attachments": [],
"size": 809,
},
"recipient": "[email protected]",
"event": "accepted",
"delivery-status": None,
},
}
}
)
response = self.client.post(
Expand Down

0 comments on commit 2cf6691

Please sign in to comment.