diff options
| author | Baptiste Mispelon <bmispelon@gmail.com> | 2014-03-14 17:20:31 +0100 |
|---|---|---|
| committer | Baptiste Mispelon <bmispelon@gmail.com> | 2014-03-14 17:21:59 +0100 |
| commit | 37f7f233f5f30c28ea60a7fbc272ffd296e2dbe1 (patch) | |
| tree | 2bbed9d0853ff6b19dccdd129dc593d417524543 /tests/field_deconstruction | |
| parent | 666a2ad22ff868c214bf251d1171148d943cfc82 (diff) | |
Fixed #22272 -- Fixed regression in DecimalField when using decimal_places=0.
Thanks to trac user merb for the report.
Diffstat (limited to 'tests/field_deconstruction')
| -rw-r--r-- | tests/field_deconstruction/tests.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/field_deconstruction/tests.py b/tests/field_deconstruction/tests.py index f7afec536a..8b5bbdf0c9 100644 --- a/tests/field_deconstruction/tests.py +++ b/tests/field_deconstruction/tests.py @@ -110,6 +110,16 @@ class FieldDeconstructionTests(TestCase): self.assertEqual(args, []) self.assertEqual(kwargs, {"max_digits": 5, "decimal_places": 2}) + def test_decimal_field_0_decimal_places(self): + """ + A DecimalField with decimal_places=0 shoudl work (#22272). + """ + field = models.DecimalField(max_digits=5, decimal_places=0) + name, path, args, kwargs = field.deconstruct() + self.assertEqual(path, "django.db.models.DecimalField") + self.assertEqual(args, []) + self.assertEqual(kwargs, {"max_digits": 5, "decimal_places": 0}) + def test_email_field(self): field = models.EmailField() name, path, args, kwargs = field.deconstruct() |
