-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send messages to emails signed as "use_as_bcc" indipendently from "se…
…nd" flag.
- Loading branch information
Showing
3 changed files
with
17 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -643,7 +643,8 @@ def test_email_field_used_as_bcc( | |
"@type": "form", | ||
"default_subject": "block subject", | ||
"default_from": "[email protected]", | ||
"send": ["recipient"], | ||
"send": False, | ||
"store": True, | ||
"subblocks": [ | ||
{ | ||
"field_id": "contact", | ||
|
@@ -683,15 +684,13 @@ def test_email_field_used_as_bcc( | |
transaction.commit() | ||
|
||
self.assertEqual(response.status_code, 200) | ||
self.assertEqual(len(self.mailhost.messages), 2) | ||
msg = self.mailhost.messages[0] | ||
bcc_msg = self.mailhost.messages[1] | ||
if isinstance(msg, bytes) and bytes is not str: | ||
# Python 3 with Products.MailHost 4.10+ | ||
msg = msg.decode("utf-8") | ||
self.assertEqual(len(self.mailhost.messages), 1) | ||
|
||
bcc_msg = self.mailhost.messages[0] | ||
|
||
if isinstance(bcc_msg, bytes) and bytes is not str: | ||
bcc_msg = bcc_msg.decode("utf-8") | ||
self.assertIn("To: [email protected]", msg) | ||
self.assertNotIn("To: [email protected]", msg) | ||
|
||
self.assertNotIn("To: [email protected]", bcc_msg) | ||
self.assertIn("To: [email protected]", bcc_msg) | ||
|
||
|