#29432: templatefilter slice needs @stringfilter decorator for 'arg' variable.
---------------------------------+--------------------------------------
Reporter: danilovmy | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version:
Severity: Normal | Resolution:
Keywords: templatefilter, | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
---------------------------------+--------------------------------------
Comment (by Tim Graham):
Can you give the example code for the use case? Adding `@stringfilter`
results in a test failure:
{{{
======================================================================
FAIL: test_fail_silently
(template_tests.filter_tests.test_slice.FunctionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/opt/python3.6.4/lib/python3.6/unittest/case.py", line 59, in
testPartExecutor
yield
File "/opt/python3.6.4/lib/python3.6/unittest/case.py", line 605, in run
testMethod()
File
"/home/tim/code/django/tests/template_tests/filter_tests/test_slice.py",
line 43, in test_fail_silently
self.assertEqual(slice_filter(obj, '0::2'), obj)
File "/opt/python3.6.4/lib/python3.6/unittest/case.py", line 829, in
assertEqual
assertion_func(first, second, msg=msg)
File "/opt/python3.6.4/lib/python3.6/unittest/case.py", line 822, in
_baseAssertEqual
raise self.failureException(msg)
AssertionError: '<betojc t07be774>' != <object object at 0x7fb7ea737b40>
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29432#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.03c648e6c390c0cb1f8136ef6086c357%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.