diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py index f1976e680d..d6a0367975 100644 --- a/tests/forms_tests/tests/test_forms.py +++ b/tests/forms_tests/tests/test_forms.py @@ -60,7 +60,7 @@ class FormsTestCase(TestCase): self.assertHTMLEqual(str(p['birthday']), '') nonexistenterror = "Key u?'nonexistentfield' not found in 'Person'" - with self.assertRaisesRegex(KeyError, nonexistenterror): + with six.assertRaisesRegex(self, KeyError, nonexistenterror): p['nonexistentfield'] self.fail('Attempts to access non-existent fields should fail.')