Ignore:
Timestamp:
Jun 16, 2010 1:35:31 PM (9 years ago)
Author:
mylan
Message:

#206: move mobile sitemap code preparation into base module

Location:
quintagroup.plonegooglesitemaps/branches/test_refactoring/quintagroup/plonegooglesitemaps/tests
Files:
4 edited

Legend:

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

    r2534 r2535  
    99 
    1010from zope.testing import doctestunit 
     11from zope.interface import Interface 
    1112from zope.component import testing 
    1213from Testing import ZopeTestCase as ztc 
     
    2526from quintagroup.plonegooglesitemaps.config import PROJECTNAME 
    2627from quintagroup.plonegooglesitemaps.config import ping_googlesitemap 
     28from quintagroup.plonegooglesitemaps.browser import mobilesitemapview 
    2729 
    2830quintagroup.plonegooglesitemaps.config.testing = 1 
    2931quintagroup.plonegooglesitemaps.config.UPDATE_CATALOG = True 
     32 
     33 
     34class IMobileMarker(Interface): 
     35    """Test Marker interface for mobile objects""" 
    3036 
    3137 
     
    4046        self.loginAsPortalOwner() 
    4147        self.workflow = self.portal.portal_workflow 
     48        self.orig_mobile_ifaces = None 
     49 
     50    def patchMobile(self): 
     51        # patch mobile sitemap view 
     52        self.orig_mobile_ifaces = mobilesitemapview.MOBILE_INTERFACES 
     53        mobilesitemapview.MOBILE_INTERFACES = [IMobileMarker.__identifier__,] 
     54 
     55    def beforeTearDown(self): 
     56        if self.orig_mobile_ifaces is not None: 
     57            mobilesitemapview.MOBILE_INTERFACES = self.orig_mobile_ifaces 
    4258 
    4359 
  • quintagroup.plonegooglesitemaps/branches/test_refactoring/quintagroup/plonegooglesitemaps/tests/testInstallation.py

    r2534 r2535  
    5858 
    5959    def afterSetUp(self): 
    60         self.loginAsPortalOwner() 
     60        super(TestGoogleSitemapsUninstallation, self).afterSetUp() 
    6161        self.portal.portal_quickinstaller.uninstallProducts( 
    6262            products=['quintagroup.plonegooglesitemaps',]) 
  • quintagroup.plonegooglesitemaps/branches/test_refactoring/quintagroup/plonegooglesitemaps/tests/testMobileSitemaps.py

    r2534 r2535  
    22from DateTime import DateTime 
    33 
    4 from zope.interface import Interface, alsoProvides 
     4from zope.interface import alsoProvides 
    55from zope.component import queryMultiAdapter 
    66from zope.component import getSiteManager, getGlobalSiteManager 
     
    1313from quintagroup.plonegooglesitemaps.browser.mobilesitemapview import MobileSitemapView 
    1414 
    15 class IMobileMarker(Interface): 
    16     """Marker interface for mobile objects""" 
    17  
    1815class TestMobileSitemapsXML(FunctionalTestCase): 
    1916 
    2017    def afterSetUp(self): 
    2118        super(TestMobileSitemapsXML, self).afterSetUp() 
    22         # patch mobile sitemap view 
    23         self.orig_mobile_ifaces = mobilesitemapview.MOBILE_INTERFACES 
    24         mobilesitemapview.MOBILE_INTERFACES = [IMobileMarker.__identifier__,] 
    25           # Create mobile sitemaps 
     19        self.patchMobile() 
    2620        _createObjectByType("Sitemap", self.portal, id="mobile-sitemap.xml", 
    2721                            sitemapType="mobile", portalTypes=("Document",)) 
     
    3529        self.workflow.doActionFor(self.my_mobile, "publish") 
    3630        self.reParse() 
    37  
    38     def beforeTearDown(self): 
    39         mobilesitemapview.MOBILE_INTERFACES = self.orig_mobile_ifaces 
    40         super(TestMobileSitemapsXML, self).beforeTearDown()  
    4131 
    4232    def reParse(self): 
  • quintagroup.plonegooglesitemaps/branches/test_refactoring/quintagroup/plonegooglesitemaps/tests/testUpgrade.py

    r2423 r2535  
    1818 
    1919    def afterSetUp(self): 
     20        super(TestUpgrade, self).afterSetUp() 
    2021        self.setup = self.portal.portal_setup 
    2122        self.profile = "quintagroup.plonegooglesitemaps:default" 
Note: See TracChangeset for help on using the changeset viewer.