diff contact/tests/test_views.py @ 892:79a71b9d0a2a

Use Reply-To header when sending mail from other users. See issue #81.
author Brian Neal <bgneal@gmail.com>
date Mon, 16 Feb 2015 20:30:48 -0600
parents 38db6ec61af3
children b957e4829a03
line wrap: on
line diff
--- a/contact/tests/test_views.py	Mon Feb 16 18:58:49 2015 -0600
+++ b/contact/tests/test_views.py	Mon Feb 16 20:30:48 2015 -0600
@@ -27,7 +27,8 @@
         self.assertEqual(len(mail.outbox), 1)
         email = mail.outbox[0]
         self.assertEqual(len(email.recipients()), 1)
-        self.assertEqual(email.from_email, post_data['email'])
+        self.assertEqual(email.extra_headers['Reply-To'], post_data['email'])
+        self.assertEqual(email.from_email, 'no_reply@example.com')
         self.assertEqual(email.recipients()[0], 'admin@surfguitar101.com')
         self.assertTrue(post_data['subject'] in email.subject)
         msg = email.message().as_string()