Example #1
0
def setUpSecurityDirectives(test=None):
    setup.placelessSetUp()
    zcml = ZCMLWrapper()
    zcml.include('schooltool.common', file='zcmlfiles.zcml')
    zcml.include('schooltool.securitypolicy', file='meta.zcml')
    zcml.include('schooltool.securitypolicy')
    zcml.setUp(namespaces={
        "": "http://namespaces.zope.org/zope",
        "security": "http://schooltool.org/securitypolicy"
    },
               i18n_domain='schooltool')
    test.globs['zcml'] = zcml
Example #2
0
def setUp(test=None):
    testing.setUp(test=test)
    zcml = ZCMLWrapper()
    zcml.include('schooltool.common', file="zcmlfiles.zcml")
    zcml.include('schooltool.traverser', file='meta.zcml')
    zcml.include('schooltool.traverser')
    test.globs['zcml'] = zcml
Example #3
0
def setUpSecurityDirectives(test=None):
    setup.placelessSetUp()
    zcml = ZCMLWrapper()
    zcml.include('schooltool.common', file='zcmlfiles.zcml')
    zcml.include('schooltool.securitypolicy', file='meta.zcml')
    zcml.include('schooltool.securitypolicy')
    zcml.setUp(
        namespaces={
            "": "http://namespaces.zope.org/zope",
            "security": "http://schooltool.org/securitypolicy"
            },
        i18n_domain='schooltool')
    test.globs['zcml'] = zcml
Example #4
0
def setUp(test=None):
    testing.setUp(test=test)
    zcml = ZCMLWrapper()
    zcml.include('schooltool.common', file="zcmlfiles.zcml")
    zcml.include('schooltool.traverser', file='meta.zcml')
    zcml.include('schooltool.traverser')
    test.globs['zcml'] = zcml
Example #5
0
def setUpIntegration(test):
    setup.placefulSetUp()
    zcml = ZCMLWrapper()
    zcml.setUp(namespaces={"": "http://namespaces.zope.org/zope"},
               i18n_domain='schooltool')
    zcml.include('schooltool.common', file='zcmlfiles.zcml')
    zcml.include('schooltool.app', file='catalog.zcml')
    root = rootFolder()
    root['app'] = provideApplicationStub()
    setup.createSiteManager(root['app'], setsite=True)
    test.globs.update({
        'zcml': zcml,
        'CatalogStub': CatalogStub,
        'provideAdapter': provideStubAdapter,
        'unregisterAdapter': unregisterStubAdapter,
    })
def setUpIntegration(test):
    setup.placefulSetUp()
    zcml = ZCMLWrapper()
    zcml.setUp(
        namespaces={"": "http://namespaces.zope.org/zope"},
        i18n_domain='schooltool')
    zcml.include('schooltool.common', file='zcmlfiles.zcml')
    zcml.include('schooltool.app', file='catalog.zcml')
    root = rootFolder()
    root['app'] = provideApplicationStub()
    setup.createSiteManager(root['app'], setsite=True)
    test.globs.update({
        'zcml': zcml,
        'CatalogStub': CatalogStub,
        'provideAdapter': provideStubAdapter,
        'unregisterAdapter': unregisterStubAdapter,
        })
Example #7
0
def setUpIntegration(test):
    setup.placefulSetUp()
    # Workaround: _clear actually sets the Zope's vocabulary registry and
    #             is called on zope.app.schema.vocabularies import (during
    #             zcml parsing, for example).  When running multiple tests
    #             this ingenious idea fails, so we call it manually.
    from zope.app.schema import vocabulary
    vocabulary._clear()

    zcml = ZCMLWrapper()
    zcml.setUp(
        namespaces={"": "http://namespaces.zope.org/zope"},
        i18n_domain='schooltool')
    zcml.include('schooltool.common', file='zcmlfiles.zcml')
    # We define the default pemissions here, because though widely used,
    # they are currently mangled with other stuff in schooltool.common
    zcml.string('''
      <permission id="schooltool.view" title="View" />
      <permission id="schooltool.edit" title="Edit Info" />
    ''')

    zcml.include('zope.intid')
    zcml.string('''
      <utility
        factory="zope.intid.IntIds"
        provides="zope.intid.interfaces.IIntIds"
      />
      <adapter
          for="persistent.interfaces.IPersistent"
          factory="schooltool.testing.stubs.KeyReferenceStub"
          trusted="y"
          />
    ''')

    zcml.include('schooltool.level', file='level.zcml')
    zcml.include('schooltool.schoolyear', file='schoolyear.zcml')
    zcml.include('schooltool.relationship', file='relationship.zcml')
    provideAdapter(LocationCopyHook)

    root = rootFolder()
    root['app'] = provideApplicationStub()
    setup.createSiteManager(root['app'], setsite=True)
    test.globs.update({
        'zcml': zcml,
        'CourseStub': CourseStub,
        'getRelatedObjects': getRelatedObjects,
        'provideAdapter': provideStubAdapter,
        'unregisterAdapter': unregisterStubAdapter,
        })
Example #8
0
def setUpIntegration(test):
    setup.placefulSetUp()
    # Workaround: _clear actually sets the Zope's vocabulary registry and
    #             is called on zope.app.schema.vocabularies import (during
    #             zcml parsing, for example).  When running multiple tests
    #             this ingenious idea fails, so we call it manually.
    from zope.app.schema import vocabulary
    vocabulary._clear()

    zcml = ZCMLWrapper()
    zcml.setUp(namespaces={"": "http://namespaces.zope.org/zope"},
               i18n_domain='schooltool')
    zcml.include('schooltool.common', file='zcmlfiles.zcml')
    # We define the default pemissions here, because though widely used,
    # they are currently mangled with other stuff in schooltool.common
    zcml.string('''
      <permission id="schooltool.view" title="View" />
      <permission id="schooltool.edit" title="Edit Info" />
    ''')

    zcml.include('zope.intid')
    zcml.string('''
      <utility
        factory="zope.intid.IntIds"
        provides="zope.intid.interfaces.IIntIds"
      />
      <adapter
          for="persistent.interfaces.IPersistent"
          factory="schooltool.testing.stubs.KeyReferenceStub"
          trusted="y"
          />
    ''')

    zcml.include('schooltool.level', file='level.zcml')
    zcml.include('schooltool.schoolyear', file='schoolyear.zcml')
    zcml.include('schooltool.relationship', file='relationship.zcml')
    provideAdapter(LocationCopyHook)

    root = rootFolder()
    root['app'] = provideApplicationStub()
    setup.createSiteManager(root['app'], setsite=True)
    test.globs.update({
        'zcml': zcml,
        'CourseStub': CourseStub,
        'getRelatedObjects': getRelatedObjects,
        'provideAdapter': provideStubAdapter,
        'unregisterAdapter': unregisterStubAdapter,
    })