Ticket #5079: 5079.2.diff
File 5079.2.diff, 866 bytes (added by , 17 years ago) |
---|
-
tests/modeltests/basic/models.py
6 6 """ 7 7 8 8 from django.db import models 9 from decimal import Decimal 9 10 10 11 class Article(models.Model): 11 12 headline = models.CharField(max_length=100, default='Default headline') … … 17 18 def __unicode__(self): 18 19 return self.headline 19 20 21 class DecimalTest(models.Model): 22 field = models.DecimalField(max_digits=40, decimal_places=30) 23 20 24 __test__ = {'API_TESTS': """ 25 >>> b1 = DecimalTest(field=Decimal(".1")) 26 >>> b1.field 27 Decimal("0.1") 28 >>> b1.save() 29 >>> b1.field 30 Decimal("0.1") 31 >>> DecimalTest.objects.get(id=1).field 32 Decimal("0.1") 33 21 34 # No articles are in the system yet. 22 35 >>> Article.objects.all() 23 36 []