Mercurial > public > sg101
comparison 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 |
comparison
equal
deleted
inserted
replaced
891:24fc302f9076 | 892:79a71b9d0a2a |
---|---|
25 self.assertRedirects(response, reverse('contact-thanks')) | 25 self.assertRedirects(response, reverse('contact-thanks')) |
26 | 26 |
27 self.assertEqual(len(mail.outbox), 1) | 27 self.assertEqual(len(mail.outbox), 1) |
28 email = mail.outbox[0] | 28 email = mail.outbox[0] |
29 self.assertEqual(len(email.recipients()), 1) | 29 self.assertEqual(len(email.recipients()), 1) |
30 self.assertEqual(email.from_email, post_data['email']) | 30 self.assertEqual(email.extra_headers['Reply-To'], post_data['email']) |
31 self.assertEqual(email.from_email, 'no_reply@example.com') | |
31 self.assertEqual(email.recipients()[0], 'admin@surfguitar101.com') | 32 self.assertEqual(email.recipients()[0], 'admin@surfguitar101.com') |
32 self.assertTrue(post_data['subject'] in email.subject) | 33 self.assertTrue(post_data['subject'] in email.subject) |
33 msg = email.message().as_string() | 34 msg = email.message().as_string() |
34 self.assertTrue(post_data['name'] in msg) | 35 self.assertTrue(post_data['name'] in msg) |
35 self.assertTrue(post_data['email'] in msg) | 36 self.assertTrue(post_data['email'] in msg) |