summaryrefslogtreecommitdiff
path: root/tests/file_storage
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-01-19 21:10:33 -0500
committerAymeric Augustin <aymeric.augustin@m4x.org>2017-01-20 08:49:47 +0100
commit109b33f64c8d3f48c9e0bd3ea8d42fe6f3cb02b7 (patch)
treece4c2311d5993e2e6b70062530834269314c0eb1 /tests/file_storage
parentdc8834cad41aa407f402dc54788df3cd37ab3e22 (diff)
downloaddjango-109b33f64c8d3f48c9e0bd3ea8d42fe6f3cb02b7.tar.gz
Refs #23919 -- Simplified assertRaisesRegex()'s that accounted for Python 2.
Diffstat (limited to 'tests/file_storage')
-rw-r--r--tests/file_storage/tests.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/file_storage/tests.py b/tests/file_storage/tests.py
index 5aee127c8c..7912eb7efa 100644
--- a/tests/file_storage/tests.py
+++ b/tests/file_storage/tests.py
@@ -45,7 +45,7 @@ class GetStorageClassTests(SimpleTestCase):
"""
get_storage_class raises an error if the requested import don't exist.
"""
- with self.assertRaisesRegex(ImportError, "No module named '?storage'?"):
+ with self.assertRaisesMessage(ImportError, "No module named 'storage'"):
get_storage_class('storage.NonExistingStorage')
def test_get_nonexisting_storage_class(self):
@@ -59,8 +59,7 @@ class GetStorageClassTests(SimpleTestCase):
"""
get_storage_class raises an error if the requested module don't exist.
"""
- # Error message may or may not be the fully qualified path.
- with self.assertRaisesRegex(ImportError, "No module named '?(django.core.files.)?non_existing_storage'?"):
+ with self.assertRaisesMessage(ImportError, "No module named 'django.core.files.non_existing_storage'"):
get_storage_class('django.core.files.non_existing_storage.NonExistingStorage')