Changeset 14022 for main/waeup.ikoba/trunk/src/waeup/ikoba
- Timestamp:
- 7 Jul 2016, 06:45:09 (8 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/interfaces.py
r12809 r14022 339 339 required = False, 340 340 readonly = False, 341 default = [],341 defaultFactory=list, 342 342 ) 343 343 … … 395 395 required = False, 396 396 readonly = False, 397 default = [],397 defaultFactory=list, 398 398 ) 399 399 -
main/waeup.ikoba/trunk/src/waeup/ikoba/products/interfaces.py
r12684 r14022 84 84 required = False, 85 85 readonly = False, 86 default = [],86 defaultFactory=list, 87 87 ) 88 88 -
main/waeup.ikoba/trunk/src/waeup/ikoba/utils/tests/test_converters.py
r12342 r14022 96 96 value_type = ProductOptionField(), 97 97 required = True, 98 default = [],98 defaultFactory=list, 99 99 ) 100 100 friends = schema.List( … … 119 119 form_fields_omit = form.Fields(IContact).omit('name', 'vip') 120 120 121 class ContactFactory(object): 122 """A factory for faculty containers. 123 """ 124 implements(IContact) 125 126 def __call__(self, *args, **kw): 127 return Faculty() 128 129 def getInterfaces(self): 130 return implementedBy(Faculty) 121 class TestContacts(unittest.TestCase): 122 # make sure the Contact class inhere works as expected 123 124 def test_default_lists_not_shared(self): 125 # 'grades' is a Contact property with empty list as default. 126 # Ensure lists are unique if set as default this test fails if 127 # `default` is set to empty list in interface. 128 c1 = Contact() 129 c2 = Contact() 130 c1.options.append('foo') 131 self.assertTrue(hasattr(c2, 'options')) 132 self.assertTrue(isinstance(c2.options, list)) 133 self.assertEqual(c2.options, []) 131 134 132 135 class FieldConverterTests(unittest.TestCase):
Note: See TracChangeset for help on using the changeset viewer.