summaryrefslogtreecommitdiff
path: root/tests/regressiontests/forms
diff options
context:
space:
mode:
authorJoseph Kocherhans <joseph@jkocherhans.com>2007-12-02 18:14:11 +0000
committerJoseph Kocherhans <joseph@jkocherhans.com>2007-12-02 18:14:11 +0000
commitb15703d32205b91b1978013612321b8f1f5bf3ae (patch)
treed83d7e4549d1f653735701078036b8f584aa4eed /tests/regressiontests/forms
parente4910ce5b720a0535837327c5ee7a0255c819d56 (diff)
newforms-admin: Fixed #5828. You can leave inline add forms empty again. Thanks brosner.
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@6837 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/forms')
-rw-r--r--tests/regressiontests/forms/widgets.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/regressiontests/forms/widgets.py b/tests/regressiontests/forms/widgets.py
index 0e69602103..ccfddc9fcd 100644
--- a/tests/regressiontests/forms/widgets.py
+++ b/tests/regressiontests/forms/widgets.py
@@ -292,6 +292,12 @@ checkboxes).
>>> w.value_from_datadict({}, {}, 'testing')
False
+The CheckboxInput widget will always be empty when there is a False value
+>>> w.is_empty(False)
+True
+>>> w.is_empty(True)
+False
+
# Select Widget ###############################################################
>>> w = Select()
@@ -453,6 +459,15 @@ over multiple times without getting consumed:
<option value="3" selected="selected">No</option>
</select>
+The NullBooleanSelect widget will always be empty when Unknown or No is selected
+as its value. This is to stay compliant with the CheckboxInput behavior
+>>> w.is_empty(False)
+True
+>>> w.is_empty(None)
+True
+>>> w.is_empty(True)
+False
+
""" + \
r""" # [This concatenation is to keep the string below the jython's 32K limit].
# SelectMultiple Widget #######################################################
@@ -895,6 +910,16 @@ u'<input id="foo_0" type="text" class="big" value="john" name="name_0" /><br /><
>>> w.render('name', ['john', 'lennon'])
u'<input id="bar_0" type="text" class="big" value="john" name="name_0" /><br /><input id="bar_1" type="text" class="small" value="lennon" name="name_1" />'
+The MultiWidget will be empty only when all widgets are considered empty.
+>>> w.is_empty(['john', 'lennon'])
+False
+>>> w.is_empty(['john', ''])
+False
+>>> w.is_empty(['', ''])
+True
+>>> w.is_empty([None, None])
+True
+
# SplitDateTimeWidget #########################################################
>>> w = SplitDateTimeWidget()