mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Replaced TOKEN_* constants by TokenType enums.
Thanks Tim Graham for the review.
This commit is contained in:
parent
1e20fedb35
commit
9c4ea63e87
4 changed files with 39 additions and 44 deletions
|
@ -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")'])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue