diff --git a/tests/auth_tests/test_views.py b/tests/auth_tests/test_views.py index f738a73e64..99de78e44d 100644 --- a/tests/auth_tests/test_views.py +++ b/tests/auth_tests/test_views.py @@ -854,7 +854,7 @@ class LoginRedirectAuthenticatedUser(AuthViewsTestCase): self.login() msg = ( "Redirection loop for authenticated user detected. Check that " - "your LOGIN_REDIRECT_URL doesn't point to a login page" + "your LOGIN_REDIRECT_URL doesn't point to a login page." ) with self.settings(LOGIN_REDIRECT_URL=self.do_redirect_url): with self.assertRaisesMessage(ValueError, msg): diff --git a/tests/file_uploads/tests.py b/tests/file_uploads/tests.py index 2824b6eb42..7b31d369b2 100644 --- a/tests/file_uploads/tests.py +++ b/tests/file_uploads/tests.py @@ -385,8 +385,8 @@ class FileUploadTests(TestCase): file.write(b'a' * (2 ** 21)) file.seek(0) - # AttributeError: You cannot alter upload handlers after the upload has been processed. - with self.assertRaises(AttributeError): + msg = 'You cannot alter upload handlers after the upload has been processed.' + with self.assertRaisesMessage(AttributeError, msg): self.client.post('/quota/broken/', {'f': file}) def test_fileupload_getlist(self): diff --git a/tests/many_to_many/tests.py b/tests/many_to_many/tests.py index 098cd29e46..f0156bbe8d 100644 --- a/tests/many_to_many/tests.py +++ b/tests/many_to_many/tests.py @@ -63,7 +63,8 @@ class ManyToManyTests(TestCase): ) # Adding an object of the wrong type raises TypeError - with self.assertRaisesMessage(TypeError, "'Publication' instance expected, got