summaryrefslogtreecommitdiff
path: root/tests/modeltests/model_forms
diff options
context:
space:
mode:
authorKaren Tracey <kmtracey@gmail.com>2009-01-19 19:43:01 +0000
committerKaren Tracey <kmtracey@gmail.com>2009-01-19 19:43:01 +0000
commit709476ae0574ee19d35640c03770377cfca6d91d (patch)
treeb149fde159dd85275bb72f406931fc37e601d1be /tests/modeltests/model_forms
parent3e19109ab61f851683d9a6427a52b4866071fa60 (diff)
[1.0.X] Fixed #10069 -- Fixed the model form unique validation code to not proceed with using, for example, RelatedObjects returned by get_field_by_name as though they were model Fields.
r9777 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9778 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/modeltests/model_forms')
-rw-r--r--tests/modeltests/model_forms/models.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/modeltests/model_forms/models.py b/tests/modeltests/model_forms/models.py
index 0489ea81d8..46d26c5cdc 100644
--- a/tests/modeltests/model_forms/models.py
+++ b/tests/modeltests/model_forms/models.py
@@ -193,6 +193,17 @@ Extra fields.
>>> CategoryForm.base_fields.keys()
['name', 'slug', 'url', 'some_extra_field']
+Extra field that has a name collision with a related object accessor.
+
+>>> class WriterForm(ModelForm):
+... book = forms.CharField(required=False)
+...
+... class Meta:
+... model = Writer
+
+>>> wf = WriterForm({'name': 'Richard Lockridge'})
+>>> wf.is_valid()
+True
Replacing a field.