1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #23919 -- Simplified assertRaisesRegex()'s that accounted for Python 2.

This commit is contained in:
Tim Graham
2017-01-19 21:10:33 -05:00
committed by Aymeric Augustin
parent dc8834cad4
commit 109b33f64c
12 changed files with 43 additions and 42 deletions

View File

@@ -146,11 +146,11 @@ class AutodiscoverModulesTestCase(SimpleTestCase):
autodiscover_modules('missing_module')
def test_autodiscover_modules_found_but_bad_module(self):
with self.assertRaisesRegex(ImportError, "No module named '?a_package_name_that_does_not_exist'?"):
with self.assertRaisesMessage(ImportError, "No module named 'a_package_name_that_does_not_exist'"):
autodiscover_modules('bad_module')
def test_autodiscover_modules_several_one_bad_module(self):
with self.assertRaisesRegex(ImportError, "No module named '?a_package_name_that_does_not_exist'?"):
with self.assertRaisesMessage(ImportError, "No module named 'a_package_name_that_does_not_exist'"):
autodiscover_modules('good_module', 'bad_module')
def test_autodiscover_modules_several_found(self):