summaryrefslogtreecommitdiff
path: root/tests/regressiontests/templates/filters.py
AgeCommit message (Collapse)Author
2013-02-26Merged regressiontests and modeltests into the test root.Florian Apolloner
2012-11-27Fixed #19370 -- Made date filter properly handle midnight valueDanilo Bargen
2012-08-18[py3] Fixed templates tests.Aymeric Augustin
2012-08-12[py3] Refactored __unicode__ to __str__.Aymeric Augustin
* Renamed the __unicode__ methods * Applied the python_2_unicode_compatible decorator * Removed the StrAndUnicode mix-in that is superseded by python_2_unicode_compatible * Kept the __unicode__ methods in classes that specifically test it under Python 2
2012-06-07Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.Claude Paroz
Thanks Vinay Sajip for the support of his django3 branch and Jannis Leidel for the review.
2012-02-09Fixed #16416 -- Added two new date formatting options for timezones and ISO ↵Jannis Leidel
week numbers. Thanks, poirier. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17473 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-12-17Fixed various dodgy behavioursAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17226 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-09-18Fixed #16676 -- Corrected the behavior of the 'add' template filter to ↵Julien Phalip
return an empty string instead of the given value unchanged in the case of an invalid use. Thanks to dtrebbien for the report and to Aymeric Augustin for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16851 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-25Add some simple regression tests for the truncatechars filter. Refs #16510.Chris Beaven
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16551 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-13Fixed #13765 - 'safe' parameter for urlencode filterLuke Plant
Thanks to KyleMac for the suggestion and SmileyChris for the patch git-svn-id: http://code.djangoproject.com/svn/django/trunk@13849 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-12Fixed #13702 -- Made sure to actually fall back to the l10n format strings ↵Jannis Leidel
provided in the settings, when disabled. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13770 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-03Fixed #11377: the template join filter now correctly escapes the joiner, too.Jacob Kaplan-Moss
Thanks, Stephen Kelly. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13464 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-15Fixed #13114 -- Modified escapejs to produce output that is JSON compliant. ↵Russell Keith-Magee
Thanks to David Danier for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12780 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-22Clarified a comment from [11687].Jacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12500 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-22Fixed #11687: the `add` filter is now less failsome when faced with things ↵Jacob Kaplan-Moss
that can't be coerced to integers. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12497 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-13Fixed #12613 -- Added Q and Z to the list of characters supported by the ↵Russell Keith-Magee
phone2numeric filter. Thanks to gabrielhurley for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12425 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-12Fixed #11972: Corrected title filter handling of numbers followed by ↵Karen Tracey
letters. Thanks schwank@gmail.com and Randy Barlow. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11822 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-09-10Fixed #11833: name conflict in filter test.Luke Plant
Thanks steveire git-svn-id: http://code.djangoproject.com/svn/django/trunk@11492 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-02Fixed #9520: make the date filter fail silently for non-date values. Thanks, ↵Jacob Kaplan-Moss
Andrew Badr and Eric Holscher. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10365 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-30Fixed #9065 -- Fixed the `timesince` and `timeuntil` template tags to work ↵Gary Wilson Jr
when both values involved are date objects, thanks to morty and mboersma for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10215 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-30Fixed #8462 -- Made `length` and `length_is` template filters fail silently ↵Gary Wilson Jr
when given a value that has undefined length and added tests for both filters. Based on patch from marcelor, rob, and SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10193 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-02Fixed #9701 -- Added a "safeseq" template filter.Malcolm Tredinnick
This is like "safe", except it operates on the individual elements of a sequence, rather than treating the whole argument as a string. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9952 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-15Fixed #6948 -- The join filter was escaping the literal value that wasMalcolm Tredinnick
passed in for the connector. This was contrary to what the documentation for autoescaping said and to what every other filter does with literal strings as arguments. This is backwards incompatible for the situation of the literal string containing one of the five special HTML characters: if you were writing {{ foo|join:"&" }}, you now have to write {{ foo| join:"&" }}. Previous behaviour was, as noted, a bug and contrary to what was documented and expected. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9442 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-28Fixed #8966 -- Changed is_safe for length_is filter to False, since its ↵Karen Tracey
return value is a boolean, not a string. Thanks Thomas Steinacher and carljm. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9291 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-26Fixed #7201 -- Fixed the timeuntil filter to work correctly with timezone-awareMalcolm Tredinnick
times. Patch from Jeremy Carbaugh. This is backwards incompatible in the sense that previously, if you tried to compare timezone-aware and timezone-naive values, you got an incorrect result. Now you get an empty string. So your previously incorrect code returns a different incorrect result. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8579 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-26Fixed #7177 -- Added extra robustness to the escapejs filter so that allMalcolm Tredinnick
invalid characters are correctly escaped. This avoids any chance to inject raw HTML inside <script> tags. Thanks to Mike Wiacek for the patch and Collin Grady for the tests. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8577 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-25Because the filter tests take non-zero time to pass, it's possible for one ofMalcolm Tredinnick
the timeuntil tests to fail because the pre-recorded "now" has moved on sufficiently far from actual "now()". Fixed the one test that was failing for me (the other timeuntil and timesince tests already have a small buffer built in to guard against this problem). The problem was revealed after [8535]. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8556 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-25Fixed #7743: Reverted [8483], which was itself a reversion of [8481], after ↵Russell Keith-Magee
confirmation from Malcolm. Corrected a long standing mistake in the timesince/timeuntil filters when using a parameter for 'now'. Thanks to Andrew Shearer <ashearerw@shearersoftware.com> for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8535 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-23Reverted [8481] and [8482] while we work out what is going on with #8453 and ↵Russell Keith-Magee
the related discussions that I wasn't previously aware of. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8486 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-23Corrected a test case error mistakenly committed in [8481].Russell Keith-Magee
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8482 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-23Fixed #7443: Corrected a long standing mistake in the timesince/timeuntil ↵Russell Keith-Magee
filters when using a parameter for 'now'. Thanks to Andrew Shearer <ashearerw@shearersoftware.com> for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8481 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-03Fixed #6279, #6514 -- Fixed some HTML escaping problems in the urlize filter.Malcolm Tredinnick
Based on a patch from SmileyChris with some test additions from Rob Hudson. Thanks, both. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7079 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-01-06Fixed #5567 -- Added a "last" filter. Based on a patch from darkpixel.Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6998 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-19Fixed #6239 -- Fixed an auto-escaping problem with urlizetrunc. Thanks, ↵Malcolm Tredinnick
SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6950 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-29Added tests and a small optimisation for [6721]. Thanks SmileyChris. Fixed #6049Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6729 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-20Fixed #5983 -- Made iriencode filter respect safe strings. Patch fromMalcolm Tredinnick
SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6706 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-17Fixed a couple of chained filter tests that weren't demonstrating what theyMalcolm Tredinnick
claimed (since the "cut" filter's behaviour had changed since I originally wrote those tests). git-svn-id: http://code.djangoproject.com/svn/django/trunk@6684 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-17Fixed some missed auto-escaping and URL quoting cases in the urlize filter.Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6683 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-17Fixed #5945 -- Treat string literals in template filter arguments as safeMalcolm Tredinnick
strings for auto-escaping purposes. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6680 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-14Implemented auto-escaping of variable output in templates. Fully ↵Malcolm Tredinnick
controllable by template authors and it's possible to write filters and templates that simulataneously work in both auto-escaped and non-auto-escaped environments if you need to. Fixed #2359 See documentation in templates.txt and templates_python.txt for how everything works. Backwards incompatible if you're inserting raw HTML output via template variables. Based on an original design from Simon Willison and with debugging help from Michael Radziej. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6671 bcc190cf-cafb-0310-a4f2-bffc1f526a37