summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKaren Tracey <kmtracey@gmail.com>2011-11-12 19:53:56 +0000
committerKaren Tracey <kmtracey@gmail.com>2011-11-12 19:53:56 +0000
commitefe4e2e5178d2d6e6f710c3edee0d07cd6a60ab5 (patch)
tree6fcce3c85a3108189fba49d2a4e1f84fdc077886 /tests
parent63ba472cc4a0ce34d28af74d11e8037a1b3d0f96 (diff)
Fix #16570: Restore ability to have decimal fields where max_digits equals decimal_places. Thanks dcwatson and kenth.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17089 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/modeltests/invalid_models/invalid_models/models.py3
-rw-r--r--tests/regressiontests/model_fields/models.py5
2 files changed, 6 insertions, 2 deletions
diff --git a/tests/modeltests/invalid_models/invalid_models/models.py b/tests/modeltests/invalid_models/invalid_models/models.py
index 422d70f21b..93c1c66f1c 100644
--- a/tests/modeltests/invalid_models/invalid_models/models.py
+++ b/tests/modeltests/invalid_models/invalid_models/models.py
@@ -243,8 +243,7 @@ invalid_models.fielderrors: "decimalfield2": DecimalFields require a "decimal_pl
invalid_models.fielderrors: "decimalfield2": DecimalFields require a "max_digits" attribute that is a positive integer.
invalid_models.fielderrors: "decimalfield3": DecimalFields require a "decimal_places" attribute that is a non-negative integer.
invalid_models.fielderrors: "decimalfield3": DecimalFields require a "max_digits" attribute that is a positive integer.
-invalid_models.fielderrors: "decimalfield4": DecimalFields require a "max_digits" attribute value that is greater than the value of the "decimal_places" attribute.
-invalid_models.fielderrors: "decimalfield5": DecimalFields require a "max_digits" attribute value that is greater than the value of the "decimal_places" attribute.
+invalid_models.fielderrors: "decimalfield4": DecimalFields require a "max_digits" attribute value that is greater than or equal to the value of the "decimal_places" attribute.
invalid_models.fielderrors: "filefield": FileFields require an "upload_to" attribute.
invalid_models.fielderrors: "choices": "choices" should be iterable (e.g., a tuple or list).
invalid_models.fielderrors: "choices2": "choices" should be a sequence of two-tuples.
diff --git a/tests/regressiontests/model_fields/models.py b/tests/regressiontests/model_fields/models.py
index 8adf7b655b..4dcfb17bb3 100644
--- a/tests/regressiontests/model_fields/models.py
+++ b/tests/regressiontests/model_fields/models.py
@@ -69,6 +69,11 @@ class BooleanModel(models.Model):
class RenamedField(models.Model):
modelname = models.IntegerField(name="fieldname", choices=((1,'One'),))
+# This model isn't used in any test, just here to ensure it validates successfully.
+# See ticket #16570.
+class DecimalLessThanOne(models.Model):
+ d = models.DecimalField(max_digits=3, decimal_places=3)
+
###############################################################################
# FileField