summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/templates/tests.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index 1a1b360847..b067cb55b0 100644
--- a/tests/regressiontests/templates/tests.py
+++ b/tests/regressiontests/templates/tests.py
@@ -1462,14 +1462,18 @@ class Templates(unittest.TestCase):
### NOW TAG ########################################################
# Simple case
- 'now01': ('{% now "j n Y"%}', {}, str(datetime.now().day) + ' ' + str(datetime.now().month) + ' ' + str(datetime.now().year)),
-
- # Check parsing of escaped and special characters
- 'now02': ('{% now "j "n" Y"%}', {}, template.TemplateSyntaxError),
- # 'now03': ('{% now "j \"n\" Y"%}', {}, str(datetime.now().day) + '"' + str(datetime.now().month) + '"' + str(datetime.now().year)),
- # 'now04': ('{% now "j \nn\n Y"%}', {}, str(datetime.now().day) + '\n' + str(datetime.now().month) + '\n' + str(datetime.now().year))
+ 'now01': ('{% now "j n Y" %}', {}, "%d %d %d" % (
+ datetime.now().day, datetime.now().month, datetime.now().year)),
# Check parsing of locale strings
- 'now05': ('{% now "DATE_FORMAT" %}', {}, date_format(datetime.now())),
+ 'now02': ('{% now "DATE_FORMAT" %}', {}, date_format(datetime.now())),
+ # Also accept simple quotes - #15092
+ 'now03': ("{% now 'j n Y' %}", {}, "%d %d %d" % (
+ datetime.now().day, datetime.now().month, datetime.now().year)),
+ 'now04': ("{% now 'DATE_FORMAT' %}", {}, date_format(datetime.now())),
+ 'now05': ('''{% now 'j "n" Y'%}''', {}, '''%d "%d" %d''' % (
+ datetime.now().day, datetime.now().month, datetime.now().year)),
+ 'now06': ('''{% now "j 'n' Y"%}''', {}, '''%d '%d' %d''' % (
+ datetime.now().day, datetime.now().month, datetime.now().year)),
### URL TAG ########################################################
# Successes