Changeset 14006 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 2 Jul 2016, 17:10:46 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_converters.py
r14005 r14006 97 97 value_type=ResultEntryField(), 98 98 required=True, 99 #defaultFactory=list, 100 default=[], 99 defaultFactory=list 101 100 ) 102 101 fav_colors = schema.List( … … 106 105 ), 107 106 required=True, 108 #defaultFactory=list 109 default=[], 107 defaultFactory=list 110 108 ) 111 109 friends = schema.List( … … 142 140 def getInterfaces(self): 143 141 return implementedBy(Faculty) 142 143 144 class TestContacts(unittest.TestCase): 145 # make sure the Contact class inhere works as expected 146 147 def test_default_lists_not_shared(self): 148 # 'grades' is a Contact property with empty list as default. 149 # Ensure lists are unique if set as default this test fails if 150 # `default` is set to empty list in interface. 151 c1 = Contact() 152 c2 = Contact() 153 c1.grades.append('foo') 154 self.assertTrue(hasattr(c2, 'grades')) 155 self.assertTrue(isinstance(c2.grades, list)) 156 self.assertEqual(c2.grades, []) 144 157 145 158
Note: See TracChangeset for help on using the changeset viewer.