Django

Code

Ticket #1145 (closed: fixed)

Opened 3 years ago

Last modified 2 years ago

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

Reported by: L.Plant.98@cantab.net Assigned to: adrian
Milestone: Component: Template system
Version: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

defaultfilters_tests_patch.diff (10.5 kB) - added by L.Plant.98@cantab.net on 12/30/05 17:33:32.
patch adding tests and fixing two bugs

Change History

12/30/05 17:33:32 changed by L.Plant.98@cantab.net

  • attachment defaultfilters_tests_patch.diff added.

patch adding tests and fixing two bugs

12/31/05 00:44:11 changed by Simon Willison

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

01/01/06 12:37:34 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #1145 ([patch] added tests for filters and fixed two bugs with filters)




Change Properties
Action