mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Refs #23919 -- Simplified assertRaisesRegex()'s that accounted for Python 2.
This commit is contained in:
parent
dc8834cad4
commit
109b33f64c
12 changed files with 43 additions and 42 deletions
|
@ -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')
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue