Code

Opened 9 years ago

Closed 9 years ago

Last modified 8 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
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: UI/UX:

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@… 9 years ago.
patch adding tests and fixing two bugs

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by L.Plant.98@…

patch adding tests and fixing two bugs

comment:1 Changed 9 years ago by Simon Willison

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

comment:2 Changed 9 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.