mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Refs #23919 -- Simplified assertRaisesRegex()'s that accounted for Python 2.
This commit is contained in:
committed by
Aymeric Augustin
parent
dc8834cad4
commit
109b33f64c
@@ -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')
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user