Skip to content

Commit

Permalink
Reverting regression in checkbox behavior. Fixes @ekarlso's issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean committed May 8, 2012
1 parent ea6aad1 commit db23a9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ class TestCheckbox(WidgetTest):
widget = CheckBox
attrs = {'css_class':'something'}
params = {'value':True}
expected = '<input checked="checked" value="True" type="checkbox" class="something"/>'
expected = '<input checked="checked" type="checkbox" class="something"/>'

def test_value_false(self):
params = {'value':False}
expected = '<input value="False" type="checkbox" class="something">'
expected = '<input type="checkbox" class="something">'
for engine in self._get_all_possible_engines():
yield self._check_rendering_vs_expected, engine, self.attrs, params, expected

Expand Down
2 changes: 1 addition & 1 deletion tw2/forms/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def prepare(self):
super(CheckBox, self).prepare()
self.safe_modify('attrs')
self.attrs['checked'] = self.value and 'checked' or None
self.value = None
self.attrs['value'] = None


class RadioButton(InputField):
Expand Down

0 comments on commit db23a9a

Please sign in to comment.