Ticket #6513: 6513_w_tests.diff

File 6513_w_tests.diff, 1005 bytes (added by Philippe Raoult, 11 years ago)

added regression tests

  • django/template/defaultfilters.py

     
    124124        d = int(arg)
    125125    except ValueError:
    126126        return force_unicode(f)
    127     m = f - int(f)
     127    try:
     128        m = f - int(f)
     129    except OverflowError:
     130        return force_unicode(f)
    128131    if not m and d < 0:
    129132        return mark_safe(u'%d' % int(f))
    130133    else:
  • tests/regressiontests/defaultfilters/tests.py

     
    3939u''
    4040>>> floatformat(None)
    4141u''
     42>>> floatformat(float('infinity'))
     43u'inf'
     44>>> floatformat(float('nan'))
     45u'nan'
    4246
    4347>>> addslashes(u'"double quotes" and \'single quotes\'')
    4448u'\\"double quotes\\" and \\\'single quotes\\\''
Back to Top