Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix unit tests for the recent e-mail changes.

The recent e-mail changes (changing from and the Return-Path addresses)
broke unit tests. This fixes the tests to check for the correct values.
  • Loading branch information...
commit 36750aa511c66f7938fa95e84a34c2740d4a74cc 1 parent 8847d97
@chipx86 chipx86 authored
Showing with 10 additions and 5 deletions.
  1. +10 −5 reviewboard/notifications/tests.py
View
15 reviewboard/notifications/tests.py
@@ -71,7 +71,8 @@ def test_new_user_email(self):
self.assertEqual(email.subject,
"New Review Board user registration for NewUser")
- self.assertEqual(email.from_email, settings.SERVER_EMAIL)
+ self.assertEqual(email.from_email, self.sender)
+ self.assertEqual(email.extra_headers['From'], settings.SERVER_EMAIL)
self.assertEqual(email.to[0], build_email_address(admin_name,
admin_email_addr))
@@ -101,7 +102,8 @@ def testNewReviewRequestEmail(self):
from_email = get_email_address_for_user(review_request.submitter)
self.assertEqual(len(mail.outbox), 1)
- self.assertEqual(mail.outbox[0].from_email, from_email)
+ self.assertEqual(mail.outbox[0].from_email, self.sender)
+ self.assertEqual(mail.outbox[0].extra_headers['From'], from_email)
self.assertEqual(mail.outbox[0].subject,
"Review Request: Made e-mail improvements")
self.assertValidRecipients(["grumpy", "doc"], [])
@@ -129,7 +131,8 @@ def testReviewEmail(self):
from_email = get_email_address_for_user(review.user)
self.assertEqual(len(mail.outbox), 1)
- self.assertEqual(mail.outbox[0].from_email, from_email)
+ self.assertEqual(mail.outbox[0].from_email, self.sender)
+ self.assertEqual(mail.outbox[0].extra_headers['From'], from_email)
self.assertEqual(mail.outbox[0].subject,
"Re: Review Request: Add permission checking " +
"for JSON API")
@@ -159,7 +162,8 @@ def testReviewReplyEmail(self):
from_email = get_email_address_for_user(reply.user)
self.assertEqual(len(mail.outbox), 1)
- self.assertEqual(mail.outbox[0].from_email, from_email)
+ self.assertEqual(mail.outbox[0].from_email, self.sender)
+ self.assertEqual(mail.outbox[0].extra_headers['From'], from_email)
self.assertEqual(mail.outbox[0].subject,
"Re: Review Request: Add permission checking " +
"for JSON API")
@@ -178,7 +182,8 @@ def testUpdateReviewRequestEmail(self):
from_email = get_email_address_for_user(review_request.submitter)
self.assertEqual(len(mail.outbox), 1)
- self.assertEqual(mail.outbox[0].from_email, from_email)
+ self.assertEqual(mail.outbox[0].from_email, self.sender)
+ self.assertEqual(mail.outbox[0].extra_headers['From'], from_email)
self.assertEqual(mail.outbox[0].subject,
"Re: Review Request: Update for cleaned_data changes")
self.assertValidRecipients(["dopey", "doc"], ["devgroup"])
Please sign in to comment.
Something went wrong with that request. Please try again.