Changeset 8190 for django/trunk/tests/regressiontests/model_fields
- Timestamp:
- 08/01/08 23:48:14 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/tests/regressiontests/model_fields/tests.py
r8142 r8190 1 1 """ 2 2 >>> from django.db.models.fields import * 3 >>> try: 4 ... from decimal import Decimal 5 ... except ImportError: 6 ... from django.utils._decimal import Decimal 3 7 4 8 # DecimalField … … 6 10 >>> f = DecimalField(max_digits=4, decimal_places=2) 7 11 8 >>> f.to_python(3) 9 Decimal("3") 12 >>> f.to_python(3) == Decimal("3") 13 True 10 14 11 >>> f.to_python("3.14") 12 Decimal("3.14") 15 >>> f.to_python("3.14") == Decimal("3.14") 16 True 13 17 14 18 >>> f.to_python("abc")
