Ticket #6783: 6783_tests.diff
File 6783_tests.diff, 1.0 KB (added by , 17 years ago) |
---|
-
tests/regressiontests/model_regress/models.py
25 25 #5218: Test models with non-default primary keys / AutoFields 26 26 movie_id = models.AutoField(primary_key=True) 27 27 name = models.CharField(max_length=60) 28 rating = models.DecimalField(max_digits=6, decimal_places=3, default=2.5) 29 28 30 29 31 __test__ = {'API_TESTS': """ 30 32 (NOTE: Part of the regression test here is merely parsing the model … … 51 53 >>> len(a4.article_text) 52 54 5000 53 55 56 # check for #6783 57 >>> from django.db.models.fields import DecimalField 58 >>> from locale import setlocale, LC_NUMERIC 59 >>> d = DecimalField(max_digits=6, decimal_places=3) 60 >>> setlocale(LC_NUMERIC,'fr_FR') 61 'fr_FR' 62 >>> print "%f" % 2.3 63 2.3 64 >>> print d.format_number(3.456) 65 3.456 66 >>> m = Movie(name = "Rambo", rating = "4.2") 67 >>> m.save() 68 54 69 """ 55 70 }