summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-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.