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

All Samples(22)  |  Call(20)  |  Derive(0)  |  Import(2)

src/a/r/archetypes.schemaextender-2.1.3/archetypes/schemaextender/tests/testOrdering.py   archetypes.schemaextender(Download)
from archetypes.schemaextender.extender import get_schema_order
from archetypes.schemaextender.extender import set_schema_order
from archetypes.schemaextender.tests.mocks import MockField
 
 
    def testSchemataOrdering(self):
        schema=ManagedSchema()
        schema.addField(MockField("one", "one"))
        schema.addField(MockField("two", "two"))
        order=get_schema_order(schema)
    def testFieldOrdering(self):
        schema=Schema()
        schema.addField(MockField("one"))
        schema.addField(MockField("two"))
        order=get_schema_order(schema)

src/a/r/archetypes.schemaextender-2.1.3/archetypes/schemaextender/tests/testSchemaFactory.py   archetypes.schemaextender(Download)
from archetypes.schemaextender.tests.mocks import Extender
from archetypes.schemaextender.tests.mocks import OrderableExtender
from archetypes.schemaextender.tests.mocks import MockField
 
 
    def testExtendWithSingleField(self):
        Extender.fields=[MockField()]
        schema=instanceSchemaFactory(self.instance)
        self.assertTrue("MockField" in schema)
 
    def testExtendTwiceCreateOnce(self):
        Extender.fields=[MockField(), MockField()]
    def testFieldOrder(self):
        Extender.fields=[MockField()]
        schema=instanceSchemaFactory(self.instance)
        order=[f.getName() for f in schema.getSchemataFields("default")]
        self.assertEqual(order[0], "MockField")