r13524 - MoreFieldsAndWidgets/archetypes.referencebrowserwidget/trunk/src/archetypes/referencebrowserwidget/tests
"Godefroid Chapelle" <[email protected]> Tue, 22 Mar 2011 12:32:36 +0000
| Newsgroups | gmane.comp.web.zope.plone.archetypes.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: gotcha
Date: Tue Mar 22 12:32:35 2011
New Revision: 13524
Modified:
MoreFieldsAndWidgets/archetypes.referencebrowserwidget/trunk/src/archetypes/referencebrowserwidget/tests/base.py
Log:
defer profile registration
GenericSetup profile_registry is "less" global.
Modified: MoreFieldsAndWidgets/archetypes.referencebrowserwidget/trunk/src/archetypes/referencebrowserwidget/tests/base.py
==============================================================================
--- MoreFieldsAndWidgets/archetypes.referencebrowserwidget/trunk/src/archetypes/referencebrowserwidget/tests/base.py (original)
+++ MoreFieldsAndWidgets/archetypes.referencebrowserwidget/trunk/src/archetypes/referencebrowserwidget/tests/base.py Tue Mar 22 12:32:35 2011
@@ -10,6 +10,7 @@
from Products.Archetypes.tests.utils import makeContent
from Products.PloneTestCase import PloneTestCase as ptc
from Products.PloneTestCase.layer import PloneSite
+from Products.PloneTestCase.layer import onsetup
from Products.PloneTestCase.setup import default_user
from Products.PloneTestCase.setup import default_password
@@ -20,17 +21,20 @@
ztc.utils.setupCoreSessions(app)
ztc.close(app)
-# setup sample types
-if not WITH_SAMPLE_TYPES:
- # if WITH_SAMPLE_TYPES is True the the profile is registered in
- # __init__.py already
- from Products.GenericSetup import EXTENSION, profile_registry
- profile_registry.registerProfile('referencebrowserwidget_sampletypes',
- 'ReferenceBrowserWidget Sample Content Types',
- 'Extension profile including referencebrowserwidget sample content types',
- 'profiles/sample_types',
- 'archetypes.referencebrowserwidget',
- EXTENSION)
+@onsetup
+def setup_sample_types():
+ # setup sample types
+ if not WITH_SAMPLE_TYPES:
+ # if WITH_SAMPLE_TYPES is True the the profile is registered in
+ # __init__.py already
+ from Products.GenericSetup import EXTENSION, profile_registry
+ profile_registry.registerProfile('referencebrowserwidget_sampletypes',
+ 'ReferenceBrowserWidget Sample Content Types',
+ 'Extension profile including referencebrowserwidget sample content types',
+ 'profiles/sample_types',
+ 'archetypes.referencebrowserwidget',
+ EXTENSION)
+setup_sample_types()
# install site
ptc.setupPloneSite(extension_profiles=[
@@ -123,4 +127,3 @@
def normalize(s):
""" Helper method for integration tests """
return ' '.join(s.split())
-
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar