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

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

src/a/r/archetypes.schematuning-1.2/src/archetypes/schematuning/tests/test_fields.py   archetypes.schematuning(Download)
            size+=s
            self.failUnless(s, 'got: %s, field: %s' % (s, k))
        self.failUnlessEqual(size, dummy.get_size())
 
    def test_validation(self):
 
        # Default
        self.failUnlessEqual(field.Vocabulary(), DisplayList())
        # DisplayList
        field.vocabulary = sampleDisplayList()
        dummy.invalidateSchema()
        self.failUnlessEqual(field.Vocabulary(), sampleDisplayList)
        field.vocabulary = ['e1', 'element2']
        dummy.invalidateSchema()
        self.failUnlessEqual(field.Vocabulary(), sampleDisplayList)
        # 2-Tuples
        field.vocabulary = [('e1', 'e1'), ('element2', 'element2')]
        dummy.invalidateSchema()
        self.failUnlessEqual(field.Vocabulary(), sampleDisplayList)

src/a/r/archetypes.schematuning-1.2/src/archetypes/schematuning/tests/test_storage.py   archetypes.schematuning(Download)
        out = ('bla','bla','bla')
 
        self.failUnlessEqual(str(dummy.getAtextfield()), 'sometext')
        self.failUnlessEqual(dummy.getAdatefield(), DateTime('2003-01-01'))
        self.failUnlessEqual(dummy.getAlinesfield(), out)
        self.failUnlessEqual(dummy.getAnobjectfield(), 'someothertext')
                self._old_storages[field.getName()] = field.getStorage()
                field.setStorage(dummy, AttributeStorage())
                self.failUnlessEqual(field.getStorage().getName(), 'AttributeStorage')
                field.setStorage(dummy, MetadataStorage())
                self.failUnlessEqual(field.getStorage().getName(), 'MetadataStorage')