source: products/quintagroup.plonegooglesitemaps/tags/1.2/quintagroup/plonegooglesitemaps/tests/base.py

Last change on this file was 2386, checked in by mylan, 14 years ago

#205: Fixed plone-3.0.X compatibility

  • Property svn:eol-style set to native
File size: 2.0 KB
Line 
1#
2# Tests for quintagroup.plonegooglesitemaps
3#
4
5import re, sys
6from urllib import urlencode
7from StringIO import StringIO
8import unittest
9
10from zope.testing import doctestunit
11from zope.component import testing
12from Testing import ZopeTestCase as ztc
13
14from Products.Five import zcml
15from Products.Five import fiveconfigure
16
17from Products.PloneTestCase import PloneTestCase as ptc
18from Products.PloneTestCase.layer import PloneSite
19
20from XMLParser import parse, hasURL
21
22import quintagroup.plonegooglesitemaps
23from quintagroup.plonegooglesitemaps.config import PROJECTNAME
24from quintagroup.plonegooglesitemaps.config import ping_googlesitemap
25
26quintagroup.plonegooglesitemaps.config.testing = 1
27quintagroup.plonegooglesitemaps.config.UPDATE_CATALOG = True
28
29
30class MixinTestCase:
31    """ Define layer and common afterSetup method with package installation.
32        Package installation on plone site setup impossible because of
33        five's registerPackage directive not recognized on module initializing.
34    """
35    layer = PloneSite
36
37    def afterSetUp(self):
38        self.loginAsPortalOwner()
39
40
41class TestCase(MixinTestCase, ptc.PloneTestCase):
42    """ For unit tests """
43
44class FunctionalTestCase(MixinTestCase, ptc.FunctionalTestCase):
45    """ For functional tests """
46
47# Initialize all needed zcml directives
48fiveconfigure.debug_mode = True
49from Products import Five, CMFCore, GenericSetup
50zcml.load_config('meta.zcml', Five)
51zcml.load_config('meta.zcml', CMFCore)
52zcml.load_config('meta.zcml', GenericSetup)
53zcml.load_config('permissions.zcml', Five)
54
55# Force quintagroup.plonegooglesitemaps zcml initialization
56zcml.load_config('configure.zcml', quintagroup.plonegooglesitemaps)
57zcml.load_config('overrides.zcml', quintagroup.plonegooglesitemaps)
58fiveconfigure.debug_mode = False
59
60# Install quintagroup.plonegooglesitemaps package and Plone site
61# with the default profile for the package
62PRODUCT = 'quintagroup.plonegooglesitemaps'
63ptc.installPackage(PRODUCT)
64ptc.setupPloneSite( products=(PRODUCT,))
Note: See TracBrowser for help on using the repository browser.