summaryrefslogtreecommitdiff
path: root/tests/template_tests/test_custom.py
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/template_tests/test_custom.py
parentdc8834cad41aa407f402dc54788df3cd37ab3e22 (diff)
Refs #23919 -- Simplified assertRaisesRegex()'s that accounted for Python 2.
Diffstat (limited to 'tests/template_tests/test_custom.py')
-rw-r--r--tests/template_tests/test_custom.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/tests/template_tests/test_custom.py b/tests/template_tests/test_custom.py
index 03d4308937..8eec22504c 100644
--- a/tests/template_tests/test_custom.py
+++ b/tests/template_tests/test_custom.py
@@ -313,25 +313,21 @@ class TemplateTagLoadingTests(SimpleTestCase):
msg = (
"Invalid template library specified. ImportError raised when "
"trying to load 'template_tests.broken_tag': cannot import name "
- "'?Xtemplate'?"
+ "'Xtemplate'"
)
- with self.assertRaisesRegex(InvalidTemplateLibrary, msg):
- Engine(libraries={
- 'broken_tag': 'template_tests.broken_tag',
- })
+ with self.assertRaisesMessage(InvalidTemplateLibrary, msg):
+ Engine(libraries={'broken_tag': 'template_tests.broken_tag'})
def test_load_error_egg(self):
egg_name = '%s/tagsegg.egg' % self.egg_dir
msg = (
"Invalid template library specified. ImportError raised when "
"trying to load 'tagsegg.templatetags.broken_egg': cannot "
- "import name '?Xtemplate'?"
+ "import name 'Xtemplate'"
)
with extend_sys_path(egg_name):
- with self.assertRaisesRegex(InvalidTemplateLibrary, msg):
- Engine(libraries={
- 'broken_egg': 'tagsegg.templatetags.broken_egg',
- })
+ with self.assertRaisesMessage(InvalidTemplateLibrary, msg):
+ Engine(libraries={'broken_egg': 'tagsegg.templatetags.broken_egg'})
def test_load_working_egg(self):
ttext = "{% load working_egg %}"