mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #27579 -- Added aliases for Python 3's assertion names in SimpleTestCase.
This commit is contained in:
@@ -7,7 +7,6 @@ from zipimport import zipimporter
|
||||
|
||||
from django.test import SimpleTestCase, TestCase, modify_settings
|
||||
from django.test.utils import extend_sys_path
|
||||
from django.utils import six
|
||||
from django.utils._os import upath
|
||||
from django.utils.module_loading import (
|
||||
autodiscover_modules, import_string, module_has_submodule,
|
||||
@@ -147,11 +146,11 @@ class AutodiscoverModulesTestCase(SimpleTestCase):
|
||||
autodiscover_modules('missing_module')
|
||||
|
||||
def test_autodiscover_modules_found_but_bad_module(self):
|
||||
with six.assertRaisesRegex(self, ImportError, "No module named '?a_package_name_that_does_not_exist'?"):
|
||||
with self.assertRaisesRegex(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 six.assertRaisesRegex(self, ImportError, "No module named '?a_package_name_that_does_not_exist'?"):
|
||||
with self.assertRaisesRegex(ImportError, "No module named '?a_package_name_that_does_not_exist'?"):
|
||||
autodiscover_modules('good_module', 'bad_module')
|
||||
|
||||
def test_autodiscover_modules_several_found(self):
|
||||
|
||||
Reference in New Issue
Block a user