summaryrefslogtreecommitdiff
path: root/tests/invalid_models
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2013-05-28 15:11:41 -0400
committerTim Graham <timograham@gmail.com>2013-05-28 15:12:47 -0400
commitded95ccdce0ba983c405ddde9eb071e454245a94 (patch)
tree1f0ebc0a4bb36b01b0e8a830acbe08964b278d73 /tests/invalid_models
parenta2967d5204729771e3716c431ea98f8ee8562d3e (diff)
Fixed #20484 -- Added model validation for GenericIPAddressField
GenericIPAddressField must not allow blank for NOT NULL fields Thanks Erik Romijn.
Diffstat (limited to 'tests/invalid_models')
-rw-r--r--tests/invalid_models/invalid_models/models.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/invalid_models/invalid_models/models.py b/tests/invalid_models/invalid_models/models.py
index 6ba3f04e5e..e1bac9cfb2 100644
--- a/tests/invalid_models/invalid_models/models.py
+++ b/tests/invalid_models/invalid_models/models.py
@@ -25,6 +25,7 @@ class FieldErrors(models.Model):
index = models.CharField(max_length=10, db_index='bad')
field_ = models.CharField(max_length=10)
nullbool = models.BooleanField(null=True)
+ generic_ip_notnull_blank = models.GenericIPAddressField(null=False, blank=True)
class Target(models.Model):
@@ -380,6 +381,7 @@ invalid_models.fielderrors: "choices2": "choices" should be a sequence of two-it
invalid_models.fielderrors: "index": "db_index" should be either None, True or False.
invalid_models.fielderrors: "field_": Field names cannot end with underscores, because this would lead to ambiguous queryset filters.
invalid_models.fielderrors: "nullbool": BooleanFields do not accept null values. Use a NullBooleanField instead.
+invalid_models.fielderrors: "generic_ip_notnull_blank": GenericIPAddressField can not accept blank values if null values are not allowed, as blank values are stored as null.
invalid_models.clash1: Accessor for field 'foreign' clashes with field 'Target.clash1_set'. Add a related_name argument to the definition for 'foreign'.
invalid_models.clash1: Accessor for field 'foreign' clashes with related m2m field 'Target.clash1_set'. Add a related_name argument to the definition for 'foreign'.
invalid_models.clash1: Reverse query name for field 'foreign' clashes with field 'Target.clash1'. Add a related_name argument to the definition for 'foreign'.