diff --git a/tests/auth_tests/test_views.py b/tests/auth_tests/test_views.py index 4949ce1bf4..e7ad1cbcdf 100644 --- a/tests/auth_tests/test_views.py +++ b/tests/auth_tests/test_views.py @@ -855,7 +855,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 fb333dcf13..ea4976dc0a 100644 --- a/tests/file_uploads/tests.py +++ b/tests/file_uploads/tests.py @@ -386,8 +386,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 933eb23a7a..71c5f92d8d 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