diff --git a/django/contrib/auth/tests/forms.py b/django/contrib/auth/tests/forms.py index 9b557d18bf..429967cba0 100644 --- a/django/contrib/auth/tests/forms.py +++ b/django/contrib/auth/tests/forms.py @@ -260,7 +260,10 @@ class PasswordResetFormTest(TestCase): 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')