Added heuristics for deserialization of boolean setting to make

checkboxes work in a SettingsForm
This commit is contained in:
Raphael Michel
2015-06-16 01:00:12 +02:00
parent 6a7680fcef
commit 6392be15fe
2 changed files with 12 additions and 6 deletions

View File

@@ -121,6 +121,14 @@ class SettingsTestCase(TestCase):
self._test_serialization(True, bool)
self._test_serialization(False, bool)
def test_serialize_bool_implicit(self):
self.event.settings.set('test', True)
self.event.settings._flush()
self.assertIs(self.event.settings.get('test', as_type=None), True)
self.event.settings.set('test', False)
self.event.settings._flush()
self.assertIs(self.event.settings.get('test', as_type=None), False)
def test_serialize_versionable(self):
self._test_serialization(self.event, Event)