tests: add test for strptime template tag

This commit is contained in:
Frédéric Péters 2015-04-15 16:14:17 +02:00
parent 72d8d5a2b3
commit fc2017c6ca
1 changed files with 6 additions and 0 deletions

View File

@ -0,0 +1,6 @@
from django.template import Context, Template
def test_strptime():
t = Template('{% load combo %}{{ someday|strptime:"%Y-%m-%d"|date:"Y" }}')
assert t.render(Context({'someday': '2015-04-15'})) == '2015'
assert t.render(Context({'someday': 'foobar'})) == ''