summaryrefslogtreecommitdiff
path: root/tests/model_fields/models.py
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2014-03-03 20:12:42 -0500
committerSimon Charette <charette.s@gmail.com>2014-03-25 14:31:54 -0400
commit78211b13a51f2ada1c7beb81ff97ef11f9e239eb (patch)
tree2bd0dd1116c06a3705f423d278ee8bf723128995 /tests/model_fields/models.py
parent7eaf329ad38ff7ea6b47f1b0a3c20ca7a5ad079b (diff)
[1.7.x] Fixed #12030 -- Validate integer field range at the model level.
Thanks to @timgraham for the review. Backport of 1506c71a95 from master
Diffstat (limited to 'tests/model_fields/models.py')
-rw-r--r--tests/model_fields/models.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/model_fields/models.py b/tests/model_fields/models.py
index c4e99c949a..d71f396d05 100644
--- a/tests/model_fields/models.py
+++ b/tests/model_fields/models.py
@@ -57,11 +57,27 @@ class BigS(models.Model):
s = models.SlugField(max_length=255)
-class BigInt(models.Model):
+class SmallIntegerModel(models.Model):
+ value = models.SmallIntegerField()
+
+
+class IntegerModel(models.Model):
+ value = models.IntegerField()
+
+
+class BigIntegerModel(models.Model):
value = models.BigIntegerField()
null_value = models.BigIntegerField(null=True, blank=True)
+class PositiveSmallIntegerModel(models.Model):
+ value = models.PositiveSmallIntegerField()
+
+
+class PositiveIntegerModel(models.Model):
+ value = models.PositiveIntegerField()
+
+
class Post(models.Model):
title = models.CharField(max_length=100)
body = models.TextField()