-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from 153957/whitelist
Fix parsing of emails for whitelist
- Loading branch information
Showing
3 changed files
with
10 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,12 +162,14 @@ def test_send_multiple(self): | |
self.assertEqual(message.get_all('to'), ['[email protected]', ]) | ||
|
||
def test_whitelist_domain(self): | ||
addresses = ['[email protected]', '[email protected]'] | ||
addresses = ['[email protected]', | ||
'<[email protected]>', | ||
'Foo Bar <[email protected]>'] | ||
emails = [EmailMessage( 'Subject', 'Content', '[email protected]', addresses)] | ||
num_sent = self.get_connection().send_messages(emails) | ||
self.assertEqual(len(emails), num_sent) | ||
messages = self.get_mailbox_content() | ||
self.assertEqual(messages[0].get_all('to'), [', '.join(addresses)]) | ||
self.assertEqual(messages[0].get_all('to')[0].replace('\n', ''), ', '.join(addresses)) | ||
|
||
|
||
class LogOnlyBackendTestCase(BaseBackendTestCase): | ||
|
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