Skip to content

Commit

Permalink
Fixed #16412 -- Prevented a contrib.auth test from failing in the p…
Browse files Browse the repository at this point in the history
…otential case where `contrib.sites` was not installed. Thanks to haras for the report and to Aymeric Augustin for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16717 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
jphalip committed Sep 3, 2011
1 parent 5c1b4ab commit 09fc775
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion django/contrib/auth/tests/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,10 @@ def test_custom_email_subject(self):
data = {'email': 'testclient@example.com'}
form = PasswordResetForm(data)
self.assertTrue(form.is_valid())
form.save()
# Since we're not providing a request object, we must provide a
# domain_override to prevent the save operation from failing in the
# potential case where contrib.sites is not installed. Refs #16412.
form.save(domain_override='example.com')
self.assertEqual(len(mail.outbox), 1)
self.assertEqual(mail.outbox[0].subject, u'Custom password reset on example.com')

Expand Down

0 comments on commit 09fc775

Please sign in to comment.