MCPcopy
hub / github.com/django/django / test_auth_conflict

Method test_auth_conflict

tests/mail/tests.py:2096–2113  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2094 # RemovedInDjango70Warning.
2095 @ignore_warnings(category=RemovedInDjango70Warning)
2096 def test_auth_conflict(self):
2097 msg = (
2098 "auth_user and auth_password cannot be used with a connection. "
2099 "Pass auth_user and auth_password to get_connection() instead."
2100 )
2101 for param in ["auth_user", "auth_password"]:
2102 with (
2103 self.subTest(param=param),
2104 self.assertRaisesMessage(TypeError, msg),
2105 ):
2106 send_mail(
2107 "subject",
2108 "body",
2109 "from@example.com",
2110 ["to@example.com"],
2111 **{param: "value"},
2112 connection=mail.get_connection(),
2113 )
2114
2115 # RemovedInDjango70Warning.
2116 @ignore_warnings(category=RemovedInDjango70Warning)

Callers

nothing calls this directly

Calls 3

send_mailFunction · 0.90
assertRaisesMessageMethod · 0.80
get_connectionMethod · 0.45

Tested by

no test coverage detected