Ticket #6783: 6783_tests.diff

File 6783_tests.diff, 1.0 KB (added by Philippe Raoult, 16 years ago)

base tests for the issue

  • tests/regressiontests/model_regress/models.py

     
    2525    #5218: Test models with non-default primary keys / AutoFields
    2626    movie_id = models.AutoField(primary_key=True)
    2727    name = models.CharField(max_length=60)
     28    rating = models.DecimalField(max_digits=6, decimal_places=3, default=2.5)
     29   
    2830
    2931__test__ = {'API_TESTS': """
    3032(NOTE: Part of the regression test here is merely parsing the model
     
    5153>>> len(a4.article_text)
    52545000
    5355
     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
     632.3
     64>>> print d.format_number(3.456)
     653.456
     66>>> m = Movie(name = "Rambo", rating = "4.2")
     67>>> m.save()
     68
    5469"""
    5570}
Back to Top