Remove pre-Django 1.8 compatibility code

This commit is contained in:
medmunds
2016-04-30 10:33:51 -07:00
parent 1372ef21eb
commit c7a8c81e32
7 changed files with 18 additions and 66 deletions

View File

@@ -169,15 +169,9 @@ class SendGridBackendStandardEmailTests(SendGridBackendMockAPITestCase):
self.message.send()
def test_reply_to(self):
# reply_to is new in Django 1.8 -- before that, you can simply include it in headers
try:
# noinspection PyArgumentList
email = mail.EmailMessage('Subject', 'Body goes here', 'from@example.com', ['to1@example.com'],
reply_to=['reply@example.com', 'Other <reply2@example.com>'],
headers={'X-Other': 'Keep'})
except TypeError:
# Pre-Django 1.8
return self.skipTest("Django version doesn't support EmailMessage(reply_to)")
email = mail.EmailMessage('Subject', 'Body goes here', 'from@example.com', ['to1@example.com'],
reply_to=['reply@example.com', 'Other <reply2@example.com>'],
headers={'X-Other': 'Keep'})
email.send()
data = self.get_api_call_data()
self.assertNotIn('replyto', data) # don't use SendGrid's replyto (it's broken); just use headers