Changeset 2549 in products


Ignore:
Timestamp:
Jun 17, 2010 2:57:02 PM (14 years ago)
Author:
mylan
Message:

#130: Fix 'ValueError?: Product factory for Sitemap was invalid' error in tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.plonegooglesitemaps/branches/plone4/quintagroup/plonegooglesitemaps/tests/base.py

    r2538 r2549  
    1717 
    1818from Products.PloneTestCase import PloneTestCase as ptc 
     19from Products.PloneTestCase.layer import onsetup 
    1920from Products.PloneTestCase.layer import PloneSite 
    2021from Products.PloneTestCase.setup import portal_owner 
     
    3031quintagroup.plonegooglesitemaps.config.testing = 1 
    3132quintagroup.plonegooglesitemaps.config.UPDATE_CATALOG = True 
     33 
     34PRODUCT = 'quintagroup.plonegooglesitemaps' 
     35 
     36@onsetup 
     37def setup_product(): 
     38    """Set up the package and its dependencies. 
     39 
     40    The @onsetup decorator causes the execution of this body to be 
     41    deferred until the setup of the Plone site testing layer. We could 
     42    have created our own layer, but this is the easiest way for Plone 
     43    integration tests. 
     44    """ 
     45    fiveconfigure.debug_mode = True 
     46    import quintagroup.plonegooglesitemaps 
     47    zcml.load_config('configure.zcml', quintagroup.plonegooglesitemaps) 
     48    zcml.load_config('overrides.zcml', quintagroup.plonegooglesitemaps) 
     49    fiveconfigure.debug_mode = False 
     50 
     51    ztc.installPackage(PRODUCT) 
     52 
     53setup_product() 
     54ptc.setupPloneSite( products=(PRODUCT,)) 
    3255 
    3356 
     
    6992        self.auth = "%s:%s" % (portal_owner, default_password) 
    7093 
    71 # Initialize all needed zcml directives 
    72 fiveconfigure.debug_mode = True 
    73 from Products import Five, CMFCore, GenericSetup 
    74 zcml.load_config('meta.zcml', Five) 
    75 zcml.load_config('meta.zcml', CMFCore) 
    76 zcml.load_config('meta.zcml', GenericSetup) 
    77 zcml.load_config('permissions.zcml', Five) 
    78  
    79 # Force quintagroup.plonegooglesitemaps zcml initialization 
    80 zcml.load_config('configure.zcml', quintagroup.plonegooglesitemaps) 
    81 zcml.load_config('overrides.zcml', quintagroup.plonegooglesitemaps) 
    82 fiveconfigure.debug_mode = False 
    83  
    84 # Install quintagroup.plonegooglesitemaps package and Plone site 
    85 # with the default profile for the package 
    86 PRODUCT = 'quintagroup.plonegooglesitemaps' 
    87 ptc.installPackage(PRODUCT) 
    88 ptc.setupPloneSite( products=(PRODUCT,)) 
Note: See TracChangeset for help on using the changeset viewer.