summaryrefslogtreecommitdiff
path: root/tests/modeltests/choices/models.py
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2008-07-27 07:22:39 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2008-07-27 07:22:39 +0000
commit661f62be3c5f810fddd3b33bcbdfe33a3077a66d (patch)
tree427d6dcabcaf5a39bb185980768973310d7ab4fd /tests/modeltests/choices/models.py
parent0e629b01c0470d46be367ff394bbe345d53a9883 (diff)
Fixed #7913 -- Corrected backwards incompatible parts of [7977] when optgroup handling was added to field choices (Ticket #4412). Thanks to Michael Elsdorfer (miracle2k) for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8102 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/modeltests/choices/models.py')
-rw-r--r--tests/modeltests/choices/models.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/modeltests/choices/models.py b/tests/modeltests/choices/models.py
index 550e655e46..e378260598 100644
--- a/tests/modeltests/choices/models.py
+++ b/tests/modeltests/choices/models.py
@@ -36,4 +36,15 @@ __test__ = {'API_TESTS':"""
u'Male'
>>> s.get_gender_display()
u'Female'
+
+# If the value for the field doesn't correspond to a valid choice,
+# the value itself is provided as a display value.
+>>> a.gender = ''
+>>> a.get_gender_display()
+u''
+
+>>> a.gender = 'U'
+>>> a.get_gender_display()
+u'U'
+
"""}