Django

Code

Ticket #3017 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

[patch] unit tests showing humanize intcomma handling floats

Reported by: SmileyChris Assigned to: adrian
Milestone: Component: Contrib apps
Version: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

The intcomma filter should handle floats, too.

Of course, the name doesn't make much sense in that case, so I have renamed to commaseparate (while keeping backwards compatibility).

Attachments

commaseparate.patch (1.9 kB) - added by SmileyChris on 11/13/06 20:37:31.
commaseparate.2.patch (2.1 kB) - added by SmileyChris on 02/12/07 16:38:05.
humanize.diff (0.9 kB) - added by russellm on 03/30/07 21:16:00.
unit test for humanize.intcomma

Change History

11/13/06 20:37:31 changed by SmileyChris

  • attachment commaseparate.patch added.

11/13/06 22:22:30 changed by SmileyChris

On a related side note, there's one spelling mistake in a docstring somewhere which misspells separate as "seperate".

I can't be bothered opening a ticket for something that negligible, but feel free to fix it as part of this one ;)

02/12/07 16:38:05 changed by SmileyChris

  • attachment commaseparate.2.patch added.

02/12/07 16:38:53 changed by SmileyChris

  • stage changed from Unreviewed to Ready for checkin.

02/12/07 23:40:27 changed by mtredinnick

I'm going to leave this one until after 0.96 (which will be "real soon now"), just to avoid any confusion with the renaming change (I realise this is backwards compatible; good thinking there). Between 0.96 and 1.0, the list of things people will have to look out for will grow and we'll include this in that.

03/30/07 21:16:00 changed by russellm

  • attachment humanize.diff added.

unit test for humanize.intcomma

03/30/07 21:18:38 changed by russellm

  • stage changed from Ready for checkin to Design decision needed.

Are you sure this change is required? I added a unit test for float separation (diff attached), and it worked fine as-is.

Can you provide a specific test case where the existing intcomma filter fails for floats?

03/31/07 02:21:17 changed by SmileyChris

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

I'm quite confused also - I can see the current method works perfectly with floats so I'm not sure why I even wrote this patch.

03/31/07 02:27:13 changed by SmileyChris

  • status changed from closed to reopened.
  • summary changed from [patch] Humanize intcomma should handle floats to [patch] unit tests showing humanize intcomma handling floats.
  • resolution deleted.
  • stage changed from Design decision needed to Ready for checkin.

Actually, the unit test may as well go in there. I opened a new ticket regarding renaming the filter to something more sane: #3884

03/31/07 06:45:25 changed by mtredinnick

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

(In [4880]) Fixed #3017 -- Added tests for humanize filter.

03/31/07 06:47:29 changed by mtredinnick

Russell: I changed one of the tests (the one with a long float) before committing, because it was vulnerable to internal floating-point representation problems. I only caught it because it failed for me.


Add/Change #3017 ([patch] unit tests showing humanize intcomma handling floats)




Change Properties
Action