Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#1145 closed defect (fixed)

[patch] added tests for filters and fixed two bugs with filters

Reported by: L.Plant.98@… Owned by: Adrian Holovaty
Component: Template system Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The patch adds tests for the defaultfilters module, and fixes two bugs discovered while doing the tests:

  • a bug in 'slice' with argument '0' (caused by use of the 'a and b or c' shortcut)
  • a rounding error in the timesince function (timesince(now - 1 day) came out as '23 hours, 59 minutes')

There remains an issue with the 'timesince' function -- is the 'milliseconds' option meant to be there? It seems strange, since 'seconds' isn't, and it isn't i18nised.

Also, some doc strings have also been updated.

Attachments (1)

defaultfilters_tests_patch.diff (10.5 KB ) - added by L.Plant.98@… 19 years ago.
patch adding tests and fixing two bugs

Download all attachments as: .zip

Change History (3)

by L.Plant.98@…, 19 years ago

patch adding tests and fixing two bugs

comment:1 by Simon Willison, 19 years ago

This is a great patch! Thanks for expanding the unit test coverage.

comment:2 by Adrian Holovaty, 19 years ago

Resolution: fixed
Status: newclosed

(In [1811]) Fixed #1145 -- Added unit tests for default template filters and fixed two bugs in filters. Thanks, Luke Plant

Note: See TracTickets for help on using tickets.
Back to Top