-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testing: imported and upgraded Plone 5.1 instance has no rr tools any…
…more
- Loading branch information
Showing
7 changed files
with
93 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# -*- coding: utf-8 -*- | ||
from plone.app.testing import PLONE_FIXTURE | ||
from plone.app.testing import PloneSandboxLayer | ||
from plone.app.upgrade.utils import loadMigrationProfile | ||
from plone.testing.z2 import FunctionalTesting | ||
from plone.testing.z2 import login | ||
from zope.component.hooks import setSite | ||
|
||
import logging | ||
import os | ||
|
||
|
||
logger = logging.getLogger(__file__) | ||
|
||
|
||
class RealUpgradeLayer(PloneSandboxLayer): | ||
defaultBases = (PLONE_FIXTURE,) | ||
|
||
# def setUpZope(self, app, configurationContext): | ||
# # load ZCML | ||
# # In 5.0 alpha we install or upgrade plone.app.caching, | ||
# # so it must be available to Zope.. | ||
# import plone.app.caching | ||
# self.loadZCML( | ||
# name='configure.zcml', | ||
# package=plone.app.caching, | ||
# ) | ||
|
||
def setUpPloneSite(self, portal): | ||
app = portal.aq_parent | ||
login(app['acl_users'], 'admin') | ||
# import old ZEXP | ||
try: | ||
path = os.path.join(os.path.abspath( | ||
os.path.dirname(__file__)), 'data', 'test-full-5_1.zexp') | ||
app._importObjectFromFile(path, verify=0) | ||
except Exception as e: | ||
import pdb; pdb.set_trace() | ||
logger.exception('Failed to import ZEXP from old site. ({})'.format(e)) | ||
else: | ||
# run upgrades | ||
self['portal'] = portal = app.test | ||
setSite(portal) | ||
if get_distribution('Products.CMFPlone').version >= '5.2': | ||
# for 5.2 we need tools as utilities | ||
loadMigrationProfile( | ||
portal.portal_setup, | ||
'profile-plone.app.upgrade.v52:to52alpha1', | ||
steps=['componentregistry']) | ||
portal.portal_migration.upgrade(swallow_errors=False) | ||
setSite(None) | ||
|
||
def tearDownPloneSite(self, portal): | ||
try: | ||
del self['portal'] | ||
except KeyError: | ||
pass | ||
|
||
|
||
REAL_UPGRADE_FIXTURE = RealUpgradeLayer() | ||
REAL_UPGRADE_FUNCTIONAL = FunctionalTesting( | ||
bases=(REAL_UPGRADE_FIXTURE,), name='plone.app.upgrade:5.1 -> 5.2') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters