Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)

src/a/r/archetypes.schemaextender-2.1.3/archetypes/schemaextender/tests/testAccessor.py   archetypes.schemaextender(Download)
    def testDefaultIndexAccessor(self):
        doc = self.folder[self.folder.invokeFactory('Document', 'doc', foo=23)]
        field = doc.getField('foo')
        self.assertEqual(field.getIndexAccessor(doc)(), 23)
 
    def testNamedIndexAccessor(self):
        doc = self.folder[self.folder.invokeFactory('Document', 'doc', bar=23)]
        field = doc.getField('bar')
        self.assertEqual(field.getAccessor(doc)(), 23)
        self.assertEqual(field.getIndexAccessor(doc)(), 'doc')