mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Replaced TOKEN_* constants by TokenType enums.
Thanks Tim Graham for the review.
This commit is contained in:
@@ -3,7 +3,7 @@ Testing some internals of the template processing. These are *not* examples to b
|
||||
"""
|
||||
from django.template import Library, TemplateSyntaxError
|
||||
from django.template.base import (
|
||||
TOKEN_BLOCK, FilterExpression, Parser, Token, Variable,
|
||||
FilterExpression, Parser, Token, TokenType, Variable,
|
||||
)
|
||||
from django.template.defaultfilters import register as filter_library
|
||||
from django.test import SimpleTestCase
|
||||
@@ -15,7 +15,7 @@ class ParserTests(SimpleTestCase):
|
||||
"""
|
||||
#7027 -- _() syntax should work with spaces
|
||||
"""
|
||||
token = Token(TOKEN_BLOCK, 'sometag _("Page not found") value|yesno:_("yes,no")')
|
||||
token = Token(TokenType.BLOCK, 'sometag _("Page not found") value|yesno:_("yes,no")')
|
||||
split = token.split_contents()
|
||||
self.assertEqual(split, ["sometag", '_("Page not found")', 'value|yesno:_("yes,no")'])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user