Changeset 3163 in products


Ignore:
Timestamp:
Apr 20, 2011 4:02:03 PM (9 years ago)
Author:
zidane
Message:

fixes pyflakes and pylint

Location:
quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/__init__.py

    r3152 r3163  
    1 import sys 
    21from AccessControl import allow_module 
    32 
     
    109from Products.Archetypes import atapi 
    1110from Products.CMFCore.utils import ContentInit 
    12 from Products.CMFCore.permissions import setDefaultRoles 
    1311 
    1412# Define a message factory for when this product is internationalised. 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/commonview.py

    r3152 r3163  
    1 from string import find 
    21from zope.interface import implements, Interface, Attribute 
    32from zope.component import queryMultiAdapter 
     
    76from Products.CMFCore.utils import getToolByName 
    87 
    9 from quintagroup.plonegooglesitemaps \ 
    10     import qPloneGoogleSitemapsMessageFactory as _ 
     8#from quintagroup.plonegooglesitemaps \ 
     9#    import qPloneGoogleSitemapsMessageFactory as _ 
    1110from quintagroup.plonegooglesitemaps.interfaces import IBlackoutFilter 
    1211from quintagroup.plonegooglesitemaps.browser.utils import additionalURLs, \ 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/configletview.py

    r3152 r3163  
    55from OFS.ObjectManager import BadRequestException 
    66from Products.Five import BrowserView 
    7 from Products.CMFCore.utils import getToolByName 
    8  
    9 from quintagroup.plonegooglesitemaps.interfaces import ISitemap 
    10 from quintagroup.plonegooglesitemaps \ 
    11     import qPloneGoogleSitemapsMessageFactory as _ 
    127 
    138 
     
    137132        view = ob and ob.defaultView() or None 
    138133        if view: 
    139             resp = self.request.RESPONSE 
     134            self.request.RESPONSE 
    140135            bview = queryMultiAdapter((ob, self.request), name=view) 
    141136            if bview: 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/mobilesitemapview.py

    r3152 r3163  
    11from DateTime import DateTime 
    2 from quintagroup.plonegooglesitemaps.browser.commonview import * 
     2from quintagroup.plonegooglesitemaps.browser.commonview \ 
     3    import CommonSitemapView, implements, ISitemapView 
    34 
    45MOBILE_INTERFACES = ['quintagroup.mobileextender.interfaces.IMobile', ] 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/newssitemapview.py

    r3152 r3163  
    33from zope.component import getMultiAdapter 
    44from plone.memoize.view import memoize 
    5 from quintagroup.plonegooglesitemaps.browser.commonview import * 
     5from quintagroup.plonegooglesitemaps.browser.commonview \ 
     6    import CommonSitemapView, implements, ISitemapView 
    67 
    78reTrailingParenthtical = re.compile("\s*\(.*\)\s*", re.S) 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/sitemapview.py

    r3152 r3163  
    11from DateTime import DateTime 
    2 from quintagroup.plonegooglesitemaps.browser.commonview import * 
     2from quintagroup.plonegooglesitemaps.browser.commonview \ 
     3    import CommonSitemapView, implements, ISitemapView 
    34 
    45 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/utils.py

    r3152 r3163  
    11import re 
    2 from zope.component import queryAdapter 
    32 
    4 from DateTime import DateTime 
    53from Missing import MV as Missing_Value 
    64from Products.CMFCore.utils import getToolByName 
    75 
    86from quintagroup.canonicalpath.interfaces import ICanonicalLink 
    9 import quintagroup.plonegooglesitemaps.config as config 
    107 
    118ADD_ZOPE = re.compile('^/') 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/config.py

    r3152 r3163  
    3131try: 
    3232    from plone import browserlayer 
     33    browserlayer 
    3334except ImportError: 
    3435    SUPPORT_BLAYER = False 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/content/sitemap.py

    r3152 r3163  
    33 
    44import string 
    5 from zope.interface import implements, directlyProvides 
     5from zope.interface import implements 
    66 
    77from Products.Archetypes import atapi 
     
    1313    import qPloneGoogleSitemapsMessageFactory as _ 
    1414from quintagroup.plonegooglesitemaps.interfaces import ISitemap 
    15 from quintagroup.plonegooglesitemaps.config import * 
     15from quintagroup.plonegooglesitemaps.config import SITEMAPS_VIEW_MAP, \ 
     16    PROJECTNAME, AVAILABLE_WF_SCRIPTS 
    1617 
    1718SitemapSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema(( 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/events.py

    r3152 r3163  
    11try: 
    22    from Products.DCWorkflow.events import AfterTransitionEvent 
     3    AfterTransitionEvent() 
    34except ImportError: 
    45    # Copy AfterTransitionEvent from Plone-3/Products.DCWorkflow.events 
    56    from zope.interface import implements 
    67    from zope.app.event.objectevent import ObjectEvent 
    7     from quintagroup.plonegooglesitemaps.interfaces import * 
     8    from quintagroup.plonegooglesitemaps.interfaces import ITransitionEvent, \ 
     9        IAfterTransitionEvent 
    810 
    911    class TransitionEvent(ObjectEvent): 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/filters.txt

    r3005 r3163  
    157157Create regular expression, which will help us to test which urls pass the filters. 
    158158 
     159    >>> import re 
    159160    >>> reloc = re.compile("<loc>%s([^\<]*)</loc>" % self.portal.absolute_url(), re.S) 
    160161 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/handlers.py

    r3152 r3163  
    22from Products.CMFCore.utils import getToolByName 
    33#from quintagroup.plonegooglesitemaps.events import AfterTransitionEvent 
    4 from quintagroup.plonegooglesitemaps.interfaces import IAfterTransitionEvent 
     4from Products.DCWorkflow.interfaces import IAfterTransitionEvent 
    55from quintagroup.plonegooglesitemaps.utils import ping_google 
    66 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/interfaces.py

    r3152 r3163  
    1 from zope import schema 
    21from zope.interface import Interface 
    32 
    4 from zope.app.container.constraints import contains 
    5 from zope.app.container.constraints import containers 
    6  
    7 from Products.DCWorkflow.interfaces import IAfterTransitionEvent 
    83from plone.browserlayer.interfaces import ILocalBrowserLayerType 
    94 
    10 from quintagroup.plonegooglesitemaps \ 
    11     import qPloneGoogleSitemapsMessageFactory as _ 
    125 
    136# -*- extra stuff goes here -*- 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/setuphandlers.py

    r3152 r3163  
    1 import sys 
    21import logging 
    32from zope.component import getSiteManager 
     
    8180    old_product = "qPloneGoogleSitemaps" 
    8281    # Get plone tools 
    83     pp = getToolByName(site, 'portal_properties') 
     82    getToolByName(site, 'portal_properties') 
    8483    skins = getToolByName(site, 'portal_skins') 
    8584    controlpanel = getToolByName(site, 'portal_controlpanel') 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/base.py

    r3152 r3163  
    33# 
    44 
    5 import re 
    6 import sys 
    7 from urllib import urlencode 
    8 from StringIO import StringIO 
    9 import unittest 
    10  
    11 from zope.testing import doctestunit 
    125from zope.interface import Interface 
    13 from zope.component import testing 
    146from zope.interface import alsoProvides 
    157from Testing import ZopeTestCase as ztc 
     
    1911 
    2012from Products.PloneTestCase import PloneTestCase as ptc 
    21 from Products.PloneTestCase.layer import onsetup 
    22 from Products.PloneTestCase.layer import PloneSite 
    2313from Products.PloneTestCase.setup import portal_owner 
    2414from Products.PloneTestCase.setup import default_password 
    2515 
    26 from XMLParser import parse, hasURL 
    27  
    2816import quintagroup.plonegooglesitemaps 
    29 from quintagroup.plonegooglesitemaps.config import PROJECTNAME 
    30 from quintagroup.plonegooglesitemaps.config import ping_googlesitemap 
    31 from quintagroup.plonegooglesitemaps.config import SUPPORT_BLAYER 
    3217from quintagroup.plonegooglesitemaps.browser import mobilesitemapview 
    3318from quintagroup.plonegooglesitemaps.interfaces import IGoogleSitemapsLayer 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testBlackoutList.py

    r3152 r3163  
    22# Tests related to general Sitemap type. 
    33# 
    4 from base import * 
     4from quintagroup.plonegooglesitemaps.tests.base import TestCase 
     5import unittest 
     6 
    57from types import ListType, TupleType 
    6 from zope import component 
    78from zope.component import queryMultiAdapter 
    89 
     
    129130 
    130131    # def testGetCorrectFilterName(self): 
     132    #     from zope import component 
    131133    #     call_names = [] 
    132134    #     origQMA = component._api.queryMultiAdapter 
     
    143145 
    144146def test_suite(): 
    145     from unittest import TestSuite, makeSuite 
    146     suite = TestSuite() 
    147     suite.addTest(makeSuite(TestBOFilters)) 
    148     suite.addTest(makeSuite(TestDefaultFilters)) 
    149     suite.addTest(makeSuite(TestBlacklistFormProcessing)) 
     147    suite = unittest.TestSuite() 
     148    suite.addTest(unittest.makeSuite(TestBOFilters)) 
     149    suite.addTest(unittest.makeSuite(TestDefaultFilters)) 
     150    suite.addTest(unittest.makeSuite(TestBlacklistFormProcessing)) 
    150151    return suite 
    151152 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testConfiglet.py

    r3152 r3163  
    33# 
    44 
    5 from base import * 
    6 from cgi import FieldStorage 
    7 from tempfile import TemporaryFile, NamedTemporaryFile 
     5from quintagroup.plonegooglesitemaps.tests.base import FunctionalTestCase 
     6from StringIO import StringIO 
     7from urllib import urlencode 
     8import unittest 
    89 
    9 from OFS.Image import cookId 
    1010from Products.CMFPlone.utils import _createObjectByType 
    11 from ZPublisher.HTTPRequest import FileUpload 
    1211 
    1312 
     
    3938        self.assertEqual(resp.getHeader("Location").endswith(sm_edit), True) 
    4039        # Add SM 
    41         sm = self.portal["sitemap.xml"] 
    42         #sm.setPortalTypes(("Documents",)) 
     40        self.portal["sitemap.xml"] 
     41        #self.portal["sitemap.xml"].setPortalTypes(("Documents",)) 
    4342        newform = self.publish(self.settingsURL, basic=self.auth).getBody() 
    4443        self.assertEqual('href="http://nohost/plone/sitemap.xml/edit"' in \ 
     
    5251        self.assertEqual(resp.getHeader("Location").endswith(sm_edit), True) 
    5352        # Add SM 
    54         sm = self.portal["news-sitemap.xml"] 
    55         #sm.setPortalTypes(("News Item",)) 
     53        self.portal["news-sitemap.xml"] 
     54        #self.portal["news-sitemap.xml"].setPortalTypes(("News Item",)) 
    5655        newform = self.publish(self.settingsURL, basic=self.auth).getBody() 
    5756        self.assertEqual('href="http://nohost/plone/news-sitemap.xml/edit"' \ 
     
    6564        self.assertEqual(resp.getHeader("Location").endswith(msm_edit), True) 
    6665        # Add SM 
    67         sm = self.portal["mobile-sitemap.xml"] 
    68         #sm.setPortalTypes(("Documents",)) 
     66        self.portal["mobile-sitemap.xml"] 
     67        #self.portal["mobile-sitemap.xml"].setPortalTypes(("Documents",)) 
    6968        newform = self.publish(self.settingsURL, basic=self.auth).getBody() 
    7069        self.assertEqual('href="http://nohost/plone/mobile-sitemap.xml/edit"' \ 
     
    9392 
    9493def test_suite(): 
    95     from unittest import TestSuite, makeSuite 
    96     suite = TestSuite() 
    97     suite.addTest(makeSuite(TestConfigletSettings)) 
    98     suite.addTest(makeSuite(TestConfigletOverview)) 
     94    suite = unittest.TestSuite() 
     95    suite.addTest(unittest.makeSuite(TestConfigletSettings)) 
     96    suite.addTest(unittest.makeSuite(TestConfigletOverview)) 
    9997    return suite 
    10098 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testGoogleSitemaps.py

    r3152 r3163  
    33# 
    44 
    5 from base import * 
     5from quintagroup.plonegooglesitemaps.tests.base import FunctionalTestCase 
     6from quintagroup.plonegooglesitemaps.tests.XMLParser import parse 
     7from StringIO import StringIO 
     8from urllib import urlencode 
     9import re 
     10import unittest 
     11 
    612from cgi import FieldStorage 
    7 from tempfile import TemporaryFile, NamedTemporaryFile 
     13from tempfile import NamedTemporaryFile 
    814 
    915from OFS.Image import cookId 
     
    149155 
    150156def test_suite(): 
    151     from unittest import TestSuite, makeSuite 
    152     suite = TestSuite() 
    153     suite.addTest(makeSuite(TestGoogleSitemaps)) 
     157    suite = unittest.TestSuite() 
     158    suite.addTest(unittest.makeSuite(TestGoogleSitemaps)) 
    154159    return suite 
    155160 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testInstallation.py

    r3152 r3163  
    1 from base import * 
     1from quintagroup.plonegooglesitemaps.config import SUPPORT_BLAYER 
     2from quintagroup.plonegooglesitemaps.tests.base import TestCase, \ 
     3    PRODUCT, IGoogleSitemapsLayer 
     4import unittest 
     5 
    26from zope.component import getSiteManager 
    37from archetypes.schemaextender.interfaces import ISchemaExtender 
     
    7175        cols = ["canonical_link", "Language", "gsm_access", 
    7276                "gsm_genres", "gsm_stock"] 
    73         lsm = getSiteManager(self.portal) 
     77        getSiteManager(self.portal) 
    7478        catalog = self.portal.portal_catalog 
    7579        setuptools = self.portal.portal_setup 
     
    152156 
    153157def test_suite(): 
    154     from unittest import TestSuite, makeSuite 
    155     suite = TestSuite() 
    156     suite.addTest(makeSuite(TestGoogleSitemapsInstallation)) 
    157     suite.addTest(makeSuite(TestGoogleSitemapsUninstallation)) 
     158    suite = unittest.TestSuite() 
     159    suite.addTest(unittest.makeSuite(TestGoogleSitemapsInstallation)) 
     160    suite.addTest(unittest.makeSuite(TestGoogleSitemapsUninstallation)) 
    158161    return suite 
    159162 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testMobileSitemaps.py

    r3152 r3163  
    1 from base import * 
     1from quintagroup.plonegooglesitemaps.tests.base import TestCase, \ 
     2    FunctionalTestCase, IMobileMarker 
     3from Products.PloneTestCase.setup import portal_owner, default_password 
     4from quintagroup.plonegooglesitemaps.tests.XMLParser import parse 
     5import unittest 
     6 
    27from DateTime import DateTime 
    38 
    49from zope.interface import alsoProvides 
    510from zope.component import queryMultiAdapter 
    6 from zope.component import getSiteManager, getGlobalSiteManager 
    7 from archetypes.schemaextender.interfaces import ISchemaExtender 
    811 
    912from Products.CMFPlone.utils import _createObjectByType 
     
    102105 
    103106def test_suite(): 
    104     from unittest import TestSuite, makeSuite 
    105     suite = TestSuite() 
    106     suite.addTest(makeSuite(TestMobileSitemapsXML)) 
    107     suite.addTest(makeSuite(TestMobileSitemaps)) 
     107    suite = unittest.TestSuite() 
     108    suite.addTest(unittest.makeSuite(TestMobileSitemapsXML)) 
     109    suite.addTest(unittest.makeSuite(TestMobileSitemaps)) 
    108110    return suite 
     111 
     112if __name__ == '__main__': 
     113    unittest.main(defaultTest='test_suite') 
     114#    framework() 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testNewsSitemaps.py

    r3152 r3163  
    1 from base import * 
     1from quintagroup.plonegooglesitemaps.tests.base \ 
     2    import FunctionalTestCase, TestCase, IGoogleSitemapsLayer 
     3from quintagroup.plonegooglesitemaps.tests.XMLParser import parse 
     4from Products.PloneTestCase.setup import portal_owner, default_password 
     5from zope.interface import alsoProvides 
     6import unittest 
     7 
    28from DateTime import DateTime 
    39from Missing import MV 
     
    178184        self.assert_("n:keywords" not in self.start.keys()) 
    179185 
    180     def test_no_keywords(self): 
     186    def test_no_stock_tickers(self): 
    181187        self.assert_("n:stock_tickers" not in self.start.keys()) 
    182188 
     
    298304        for n, func in self.nsmv.additional_maps: 
    299305            try: 
    300                 v = func(self.brain) 
     306                func(self.brain) 
    301307            except Exception, e: 
    302308                self.fail("Wrong processing 'Missing' value for '%s': %s" \ 
     
    305311 
    306312def test_suite(): 
    307     from unittest import TestSuite, makeSuite 
    308     suite = TestSuite() 
    309     suite.addTest(makeSuite(TestNewsSitemapsXML)) 
    310     suite.addTest(makeSuite(TestNewsSitemapsXMLDefaultObject)) 
    311     suite.addTest(makeSuite(TestSchemaExtending)) 
    312     suite.addTest(makeSuite(TestNotOverrideExistingSchemaExtender)) 
    313     suite.addTest(makeSuite(TestAdditionalMaps)) 
     313    suite = unittest.TestSuite() 
     314    suite.addTest(unittest.makeSuite(TestNewsSitemapsXML)) 
     315    suite.addTest(unittest.makeSuite(TestNewsSitemapsXMLDefaultObject)) 
     316    suite.addTest(unittest.makeSuite(TestSchemaExtending)) 
     317    suite.addTest(unittest.makeSuite(TestNotOverrideExistingSchemaExtender)) 
     318    suite.addTest(unittest.makeSuite(TestAdditionalMaps)) 
    314319    return suite 
     320 
     321if __name__ == '__main__': 
     322    unittest.main(defaultTest='test_suite') 
     323#    framework() 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testPinging.py

    r3152 r3163  
    1 from base import * 
     1from quintagroup.plonegooglesitemaps.tests.base import FunctionalTestCase 
     2import sys 
     3from StringIO import StringIO 
     4import unittest 
     5 
    26from Products.CMFPlone.utils import _createObjectByType 
    37 
     
    7276        sys.stdout = myout 
    7377        try: 
    74             response = self.publish("%s?%s" % (formUrl, qs), basic=self.auth) 
     78            self.publish("%s?%s" % (formUrl, qs), basic=self.auth) 
    7579            myout.seek(0) 
    7680            data = myout.read() 
     
    8791 
    8892def test_suite(): 
    89     from unittest import TestSuite, makeSuite 
    90     suite = TestSuite() 
    91     suite.addTest(makeSuite(TestPinging)) 
     93    suite = unittest.TestSuite() 
     94    suite.addTest(unittest.makeSuite(TestPinging)) 
    9295    return suite 
    9396 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testSecurity.py

    r3152 r3163  
    22# Tests related to general Sitemap type. 
    33# 
    4 from base import * 
     4from quintagroup.plonegooglesitemaps.tests.base \ 
     5    import FunctionalTestCase, IMobileMarker 
     6from quintagroup.plonegooglesitemaps.tests.XMLParser import parse 
     7 
     8import unittest 
    59from zope.interface import alsoProvides 
    6 from Products.Archetypes import atapi 
    710from Products.CMFPlone.utils import _createObjectByType 
    811 
     
    124127 
    125128def test_suite(): 
    126     from unittest import TestSuite, makeSuite 
    127     suite = TestSuite() 
    128     suite.addTest(makeSuite(TestSecurityConfigletManager)) 
    129     suite.addTest(makeSuite(TestSecurityConfigletNotManager)) 
    130     suite.addTest(makeSuite(TestSecuritySiteMaps)) 
     129    suite = unittest.TestSuite() 
     130    suite.addTest(unittest.makeSuite(TestSecurityConfigletManager)) 
     131    suite.addTest(unittest.makeSuite(TestSecurityConfigletNotManager)) 
     132    suite.addTest(unittest.makeSuite(TestSecuritySiteMaps)) 
    131133    return suite 
    132134 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testSitemaps.py

    r3152 r3163  
    22# Tests related to general Sitemap type. 
    33# 
    4 from base import * 
     4from quintagroup.plonegooglesitemaps.tests.base \ 
     5    import FunctionalTestCase, TestCase, IMobileMarker 
     6from quintagroup.plonegooglesitemaps.config import ping_googlesitemap 
     7from StringIO import StringIO 
     8from urllib import urlencode 
     9import sys 
     10from XMLParser import hasURL 
     11import unittest 
     12 
    513from DateTime import DateTime 
    614from zope.interface import alsoProvides 
     
    8088        self.assertEqual("published" in wfstates.keys(), True) 
    8189 
    82     def testWorkflowStates(self): 
     90    def testWorkflowTransitions(self): 
    8391        wftrans = self.contentSM.getWorkflowTransitions() 
    8492        self.assertEqual(isinstance(wftrans, atapi.DisplayList), True) 
     
    239247        sys.stdout = myout 
    240248        try: 
    241             response = self.publish("%s?%s" % (formUrl, qs), basic=self.auth) 
     249            self.publish("%s?%s" % (formUrl, qs), basic=self.auth) 
    242250            myout.seek(0) 
    243251            data = myout.read() 
     
    299307 
    300308def test_suite(): 
    301     from unittest import TestSuite, makeSuite 
    302     suite = TestSuite() 
    303     suite.addTest(makeSuite(TestSitemapType)) 
    304     suite.addTest(makeSuite(TestSettings)) 
    305     suite.addTest(makeSuite(TestPinging)) 
    306     suite.addTest(makeSuite(TestContextSearch)) 
     309    suite = unittest.TestSuite() 
     310    suite.addTest(unittest.makeSuite(TestSitemapType)) 
     311    suite.addTest(unittest.makeSuite(TestSettings)) 
     312    suite.addTest(unittest.makeSuite(TestPinging)) 
     313    suite.addTest(unittest.makeSuite(TestContextSearch)) 
    307314    return suite 
    308315 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testUpgrade.py

    r3152 r3163  
    44 
    55import logging 
    6 from base import * 
    7 from zope.component import getSiteManager 
     6 
     7from quintagroup.plonegooglesitemaps.tests.base import TestCase 
     8import unittest 
     9 
    810from StringIO import StringIO 
    911 
    1012from Products.CMFPlone.utils import _createObjectByType 
    1113from Products.GenericSetup.upgrade import _upgrade_registry 
    12 from archetypes.schemaextender.interfaces import ISchemaExtender 
    1314from quintagroup.plonegooglesitemaps import config 
    1415from quintagroup.plonegooglesitemaps import upgrades as gsm_upgrades 
     
    194195 
    195196def test_suite(): 
    196     from unittest import TestSuite, makeSuite 
    197     suite = TestSuite() 
    198     suite.addTest(makeSuite(TestUpgrade)) 
     197    suite = unittest.TestSuite() 
     198    suite.addTest(unittest.makeSuite(TestUpgrade)) 
    199199    if PRESENT_OLD_PRODUCT: 
    200         suite.addTest(makeSuite(TestMigrationFromProduct)) 
     200        suite.addTest(unittest.makeSuite(TestMigrationFromProduct)) 
    201201 
    202202    return suite 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/test_doctest.py

    r3152 r3163  
    22import doctest 
    33 
    4 from base import * 
     4from base import FunctionalTestCase 
     5from Testing import ZopeTestCase as ztc 
    56from Products.CMFPlone.utils import _createObjectByType 
    67 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/utils.py

    r3152 r3163  
    33 
    44from Globals import DevelopmentMode 
    5 from OFS.ObjectManager import BadRequestException 
     5#from OFS.ObjectManager import BadRequestException 
    66 
    77from quintagroup.plonegooglesitemaps import config 
     
    2222    g = urlopen('http://www.google.com/webmasters/tools/ping?sitemap=' + \ 
    2323                sitemap_url) 
    24     result = g.read() 
     24    g.read() 
    2525    g.close() 
    2626 
Note: See TracChangeset for help on using the changeset viewer.