summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Beaven <smileychris@gmail.com>2010-10-21 21:17:07 +0000
committerChris Beaven <smileychris@gmail.com>2010-10-21 21:17:07 +0000
commit051bf1cf12b85b1d1df50bca10fb9cc246fb6804 (patch)
treeda88cde5f12a1fd98890a4a9def4bfb697b1bcd8 /tests
parent085e4c9112600b84cef601bc331cafae03c1b1c9 (diff)
Fixed 14513 -- check fields with underscores for validity when ordering. Bonus points to Klaas van Schelven.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14315 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/modeltests/invalid_models/models.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/modeltests/invalid_models/models.py b/tests/modeltests/invalid_models/models.py
index b263390c39..ef3edd8563 100644
--- a/tests/modeltests/invalid_models/models.py
+++ b/tests/modeltests/invalid_models/models.py
@@ -206,6 +206,9 @@ class UniqueFKTarget2(models.Model):
""" Model to test for unique FK target in previously seen model: expect no error """
tgt = models.ForeignKey(FKTarget, to_field='good')
+class NonExistingOrderingWithSingleUnderscore(models.Model):
+ class Meta:
+ ordering = ("does_not_exist",)
model_errors = """invalid_models.fielderrors: "charfield": CharFields require a "max_length" attribute that is a positive integer.
invalid_models.fielderrors: "charfield2": CharFields require a "max_length" attribute that is a positive integer.
@@ -311,4 +314,5 @@ invalid_models.abstractrelationmodel: 'fk2' has an m2m relation with model Abstr
invalid_models.uniquem2m: ManyToManyFields cannot be unique. Remove the unique argument on 'unique_people'.
invalid_models.nonuniquefktarget1: Field 'bad' under model 'FKTarget' must have a unique=True constraint.
invalid_models.nonuniquefktarget2: Field 'bad' under model 'FKTarget' must have a unique=True constraint.
+invalid_models.nonexistingorderingwithsingleunderscore: "ordering" refers to "does_not_exist", a field that doesn't exist.
"""