diff --git a/django/contrib/auth/tests/views.py b/django/contrib/auth/tests/views.py index 42bea825f5..48dfc9ed76 100644 --- a/django/contrib/auth/tests/views.py +++ b/django/contrib/auth/tests/views.py @@ -53,7 +53,7 @@ class AuthViewsTestCase(TestCase): def assertFormError(self, response, error): """Assert that error is found in response.context['form'] errors""" form_errors = list(itertools.chain(*response.context['form'].errors.values())) - self.assertIn(force_text(text), form_errors) + self.assertIn(force_text(error), form_errors) @skipIfCustomUser