tests: add test for strptime template tag
This commit is contained in:
parent
72d8d5a2b3
commit
fc2017c6ca
|
@ -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'})) == ''
|
Loading…
Reference in New Issue