diff --git a/django/forms/widgets.py b/django/forms/widgets.py
index c761ea8..4782b99 100644
a
|
b
|
class CheckboxInput(Widget):
|
533 | 533 | def _has_changed(self, initial, data): |
534 | 534 | # Sometimes data or initial could be None or '' which should be the |
535 | 535 | # same thing as False. |
| 536 | if initial == 'False': |
| 537 | # show_hidden_initial may have transformed False to 'False' |
| 538 | initial = False |
536 | 539 | return bool(initial) != bool(data) |
537 | 540 | |
538 | 541 | class Select(Widget): |
diff --git a/tests/regressiontests/forms/tests/widgets.py b/tests/regressiontests/forms/tests/widgets.py
index 31c0e65..f9dc4a7 100644
a
|
b
|
class FormsWidgetTestCase(TestCase):
|
240 | 240 | self.assertTrue(w._has_changed(False, 'on')) |
241 | 241 | self.assertFalse(w._has_changed(True, 'on')) |
242 | 242 | self.assertTrue(w._has_changed(True, '')) |
| 243 | # Initial value may have mutated to a string due to show_hidden_initial (#19537) |
| 244 | self.assertTrue(w._has_changed('False', 'on')) |
243 | 245 | |
244 | 246 | def test_select(self): |
245 | 247 | w = Select() |