diff --git a/django/forms/widgets.py b/django/forms/widgets.py
index 5b50f37..57334f8 100644
a
|
b
|
class CheckboxInput(Widget):
|
478 | 478 | result = False |
479 | 479 | if result: |
480 | 480 | final_attrs['checked'] = 'checked' |
481 | | if value not in ('', True, False, None): |
| 481 | if value is 1 or value not in ('', True, False, None): |
482 | 482 | # Only add the 'value' attribute if a value is non-empty. |
483 | 483 | final_attrs['value'] = force_unicode(value) |
484 | 484 | return mark_safe(u'<input%s />' % flatatt(final_attrs)) |
diff --git a/tests/regressiontests/forms/tests/widgets.py b/tests/regressiontests/forms/tests/widgets.py
index 2424bea..e84d1fe 100644
a
|
b
|
class FormsWidgetTestCase(TestCase):
|
188 | 188 | self.assertEqual(w.render('is_cool', None), u'<input type="checkbox" name="is_cool" />') |
189 | 189 | self.assertEqual(w.render('is_cool', False), u'<input type="checkbox" name="is_cool" />') |
190 | 190 | self.assertEqual(w.render('is_cool', True), u'<input checked="checked" type="checkbox" name="is_cool" />') |
| 191 | self.assertEqual(w.render('is_cool', 1), u'<input checked="checked" type="checkbox" name="is_cool" value="1" />') |
191 | 192 | |
192 | 193 | # Using any value that's not in ('', None, False, True) will check the checkbox |
193 | 194 | # and set the 'value' attribute. |