Esempio n. 1
0
    def setUpPloneSite(self, portal):
        session.current_session = session.BuilderSession()
        session.current_session.session = create_session()
        super(ContentFixtureLayer, self).setUpPloneSite(portal)

        portal.portal_languages.use_combined_language_codes = True
        portal.portal_languages.addSupportedLanguage('de-ch')

        if not DB_CACHE_MANAGER.is_loaded_from_cache(CACHE_GEVER_FIXTURE):
            sqlite_testing.create_tables()
            # Avoid circular imports:
            from opengever.testing.fixtures import OpengeverContentFixture
            setRequest(portal.REQUEST)
            self['fixture_lookup_table'] = OpengeverContentFixture()()
            setRequest(None)
            DB_CACHE_MANAGER.data['fixture_lookup_table'] = (
                self['fixture_lookup_table'])
            DB_CACHE_MANAGER.dump_to_cache(self['zodbDB'], CACHE_GEVER_FIXTURE)
        else:
            DB_CACHE_MANAGER.apply_cache_fixes(CACHE_GEVER_FIXTURE)
            self['fixture_lookup_table'] = (
                DB_CACHE_MANAGER.data['fixture_lookup_table'])

        # bumblebee should only be turned on on-demand with the feature flag.
        # if this assertion fails a profile in the fixture enables bumblebee,
        # or if was left on by mistake after fixture setup.
        assert not is_bumblebee_feature_enabled()
Esempio n. 2
0
 def installOpengeverProfiles(self, portal):
     if not DB_CACHE_MANAGER.is_loaded_from_cache(CACHE_GEVER_INSTALLATION):
         super(ContentFixtureLayer, self).installOpengeverProfiles(portal)
         DB_CACHE_MANAGER.dump_to_cache(self['zodbDB'],
                                        CACHE_GEVER_INSTALLATION)
     else:
         DB_CACHE_MANAGER.apply_cache_fixes(CACHE_GEVER_INSTALLATION)
Esempio n. 3
0
    def setUpPloneSite(self, portal):
        session.current_session = session.BuilderSession()
        session.current_session.session = create_session()
        super(ContentFixtureLayer, self).setUpPloneSite(portal)

        portal.portal_languages.use_combined_language_codes = True
        portal.portal_languages.addSupportedLanguage('de-ch')

        if not DB_CACHE_MANAGER.is_loaded_from_cache(CACHE_GEVER_FIXTURE):
            sqlite_testing.create_tables()
            # Avoid circular imports:
            from opengever.testing.fixtures import OpengeverContentFixture
            setRequest(portal.REQUEST)
            self['fixture_lookup_table'] = OpengeverContentFixture()()
            setRequest(None)
            DB_CACHE_MANAGER.data['fixture_lookup_table'] = (
                self['fixture_lookup_table'])
            DB_CACHE_MANAGER.dump_to_cache(self['zodbDB'], CACHE_GEVER_FIXTURE)
        else:
            DB_CACHE_MANAGER.apply_cache_fixes(CACHE_GEVER_FIXTURE)
            self['fixture_lookup_table'] = (
                DB_CACHE_MANAGER.data['fixture_lookup_table'])