Django

Code

Show
Ignore:
Timestamp:
08/01/08 23:48:14 (2 months ago)
Author:
gwilson
Message:

Fixed #7920 -- Made tests compatible with Python 2.6's Decimal repr change, patch from Karen Tracey.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/regressiontests/model_fields/tests.py

    r8142 r8190  
    11""" 
    22>>> from django.db.models.fields import * 
     3>>> try: 
     4...     from decimal import Decimal 
     5... except ImportError: 
     6...     from django.utils._decimal import Decimal 
    37 
    48# DecimalField 
     
    610>>> f = DecimalField(max_digits=4, decimal_places=2) 
    711 
    8 >>> f.to_python(3) 
    9 Decimal("3") 
     12>>> f.to_python(3) == Decimal("3") 
     13True 
    1014 
    11 >>> f.to_python("3.14") 
    12 Decimal("3.14") 
     15>>> f.to_python("3.14") == Decimal("3.14") 
     16True 
    1317 
    1418>>> f.to_python("abc")