diff options
| author | Tim Graham <timograham@gmail.com> | 2016-12-07 17:42:31 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-12-07 17:42:31 -0500 |
| commit | b5f0b3478dfcf0335f8ac2038d59f54b4a05f2a0 (patch) | |
| tree | f3eb61bfdcf45c7b27fe3c480e9a7533746d1aad /tests/template_tests | |
| parent | f909fa84bedb51778a175aadfe4cfe7a91fe06cd (diff) | |
Fixed #27579 -- Added aliases for Python 3's assertion names in SimpleTestCase.
Diffstat (limited to 'tests/template_tests')
| -rw-r--r-- | tests/template_tests/test_custom.py | 4 | ||||
| -rw-r--r-- | tests/template_tests/test_parser.py | 8 |
2 files changed, 5 insertions, 7 deletions
diff --git a/tests/template_tests/test_custom.py b/tests/template_tests/test_custom.py index e1df10c760..e6a876086e 100644 --- a/tests/template_tests/test_custom.py +++ b/tests/template_tests/test_custom.py @@ -342,7 +342,7 @@ class TemplateTagLoadingTests(SimpleTestCase): "trying to load 'template_tests.broken_tag': cannot import name " "'?Xtemplate'?" ) - with six.assertRaisesRegex(self, InvalidTemplateLibrary, msg): + with self.assertRaisesRegex(InvalidTemplateLibrary, msg): Engine(libraries={ 'broken_tag': 'template_tests.broken_tag', }) @@ -355,7 +355,7 @@ class TemplateTagLoadingTests(SimpleTestCase): "import name '?Xtemplate'?" ) with extend_sys_path(egg_name): - with six.assertRaisesRegex(self, InvalidTemplateLibrary, msg): + with self.assertRaisesRegex(InvalidTemplateLibrary, msg): Engine(libraries={ 'broken_egg': 'tagsegg.templatetags.broken_egg', }) diff --git a/tests/template_tests/test_parser.py b/tests/template_tests/test_parser.py index cf7cae0466..c6800f68dc 100644 --- a/tests/template_tests/test_parser.py +++ b/tests/template_tests/test_parser.py @@ -3,17 +3,15 @@ Testing some internals of the template processing. These are *not* examples to b """ from __future__ import unicode_literals -from unittest import TestCase - from django.template import Library, TemplateSyntaxError from django.template.base import ( TOKEN_BLOCK, FilterExpression, Parser, Token, Variable, ) from django.template.defaultfilters import register as filter_library -from django.utils import six +from django.test import SimpleTestCase -class ParserTests(TestCase): +class ParserTests(SimpleTestCase): def test_token_smart_split(self): """ @@ -72,7 +70,7 @@ class ParserTests(TestCase): Variable("article._hidden") # Variables should raise on non string type - with six.assertRaisesRegex(self, TypeError, "Variable must be a string or number, got <(class|type) 'dict'>"): + with self.assertRaisesRegex(TypeError, "Variable must be a string or number, got <(class|type) 'dict'>"): Variable({}) def test_filter_args_count(self): |
