Skip to content

Commit 4f4461a

Browse files
committed
Tests: update Mandrill integration
Mandrill has changed status code for invalid from_email from 500 to 400. (We don't actually care about the specific code, just that the error is caught and reported.)
1 parent 8a72f89 commit 4f4461a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

tests/test_mandrill_integration.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,11 @@ def test_all_options(self):
108108

109109
def test_invalid_from(self):
110110
# Example of trying to send from an invalid address
111-
# Mandrill returns a 500 response (which raises a MandrillAPIError)
112111
self.message.from_email = (
113112
"webmaster@localhost" # Django default DEFAULT_FROM_EMAIL
114113
)
115-
with self.assertRaises(AnymailAPIError) as cm:
114+
with self.assertRaisesMessage(AnymailAPIError, "email address is invalid"):
116115
self.message.send()
117-
err = cm.exception
118-
self.assertEqual(err.status_code, 500)
119-
self.assertIn("email address is invalid", str(err))
120116

121117
def test_invalid_to(self):
122118
# Example of detecting when a recipient is not a valid email address

0 commit comments

Comments
 (0)