Utils: Finish ParsedEmail --> EmailAddress conversion

Within an EmailAddress (previously ParsedEmail object), properties
now match Python 3.6 email.headerregistry.Address naming:

* .email --> .addr_spec
* .name --> .display_name
* .localpart --> .username

(Completes work started in 386668908423d1d4eade90cf7a21a546a1e96514;
this updates remaining uses of old names and removes them.)
This commit is contained in:
medmunds
2017-10-27 17:53:13 -07:00
parent bb68f3dd6d
commit 9acf6501b5
10 changed files with 40 additions and 56 deletions

View File

@@ -38,7 +38,7 @@ class TestPreSendSignal(TestBackendTestCase):
self.message.to = ['legit@example.com', 'bad@example.com']
self.message.send()
params = self.get_send_params()
self.assertEqual([email.email for email in params['to']], # params['to'] is ParsedEmail list
self.assertEqual([email.addr_spec for email in params['to']], # params['to'] is EmailAddress list
['legit@example.com'])
self.assertRegex(params['text_body'],
r"If you have received this message in error, ignore it$")