3
0
Fork 0

fix: correct "empty option" behavior for ObjectRef schema type

This commit is contained in:
Lance Edgar 2024-12-11 09:48:50 -06:00
parent 16ed125113
commit 74e2a4f0e2
5 changed files with 22 additions and 2 deletions

View file

@ -102,6 +102,11 @@ class TestObjectRef(DataTestCase):
value = typ.serialize(node, person)
self.assertEqual(value, person.uuid.hex)
# null w/ empty option
typ = mod.ObjectRef(self.request, empty_option=('bad', 'BAD'))
value = typ.serialize(node, colander.null)
self.assertEqual(value, 'bad')
def test_deserialize(self):
model = self.app.model
node = colander.SchemaNode(colander.String())