source: products/quintagroup.pfg.captcha/trunk/quintagroup/pfg/captcha/tests/base.py @ 2737

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

Merged revisions 3750,3767-3774 via svnmerge from
http://svn.quintagroup.com/products/quintagroup.pfg.captcha/branches/migration

........

r3750 | mylan | 2010-07-20 23:44:36 +0300 (Tue, 20 Jul 2010) | 1 line


#222: Added basic structure of migration Product to Package

........

r3767 | mylan | 2010-08-09 20:59:55 +0300 (Mon, 09 Aug 2010) | 1 line


Fix validator registration breakage

........

r3768 | mylan | 2010-08-09 21:07:08 +0300 (Mon, 09 Aug 2010) | 1 line


#222: Added migratioin old Products.qPloneCaptchaField to quintagroup.pfg.captcha fields

........

r3769 | mylan | 2010-08-10 12:19:58 +0300 (Tue, 10 Aug 2010) | 1 line


#222: Fix typo

........

r3770 | mylan | 2010-08-10 12:59:59 +0300 (Tue, 10 Aug 2010) | 1 line


#222: Move installation quintagroup.pfg.captcha with dependecies from global setupPloneSite to TestCase? classes

........

r3771 | mylan | 2010-08-10 14:09:48 +0300 (Tue, 10 Aug 2010) | 1 line


#222: Splited tests.py module into 2 layers with notinstalled and installed quintagroup.pfg.captcha packages

........

r3772 | mylan | 2010-08-10 17:43:03 +0300 (Tue, 10 Aug 2010) | 1 line


#222: Fix uninstallation 'old' packages when second run quintagroup.pfg.captcha installation

........

r3773 | mylan | 2010-08-10 17:43:54 +0300 (Tue, 10 Aug 2010) | 1 line


#222: Added test for migration from old qPloneCaptchaField to new quintagroup.pfg.captcha

........

r3774 | mylan | 2010-08-10 18:03:41 +0300 (Tue, 10 Aug 2010) | 1 line


#222: Prepare to 1.0.1 release

........

  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
1import re
2import string
3import unittest
4import transaction
5
6from Products.Five import zcml
7from Products.Five import fiveconfigure
8from Testing import ZopeTestCase as ztc
9
10from Products.PloneTestCase.layer import PloneSite
11from Products.PloneTestCase import setup as ptc_setup
12from Products.PloneTestCase import PloneTestCase as ptc
13
14PACKAGES = [
15    'quintagroup.captcha.core',
16    'quintagroup.pfg.captcha',
17]
18REQUIREMENTS = ['PloneFormGen',] + PACKAGES
19
20ptc.setupPloneSite()
21
22class NotInstalled(PloneSite):
23    """ Only package register, without installation into portal
24    """
25    @classmethod
26    def setUp(cls):
27        fiveconfigure.debug_mode = True
28        import quintagroup.pfg.captcha
29        zcml.load_config('configure.zcml', quintagroup.pfg.captcha)
30        fiveconfigure.debug_mode = False
31        ztc.installProduct('PloneFormGen')
32        ztc.installPackage('quintagroup.pfg.captcha')
33        ztc.installPackage('quintagroup.captcha.core')
34
35    @classmethod
36    def tearDown(cls):
37        ptc_setup.cleanupPloneSite(ptc_setup.portal_name)
38
39
40class Installed(NotInstalled):
41    """ Install product into the portal
42    """
43    @classmethod
44    def setUp(cls):
45        app = ztc.app()
46        portal = app[ptc_setup.portal_name]
47
48        # Sets the local site/manager
49        ptc_setup._placefulSetUp(portal)
50        # Install PROJECT
51        qi = getattr(portal, 'portal_quickinstaller', None)
52        qi.installProduct("quintagroup.pfg.captcha")
53        transaction.commit()
54
55    @classmethod
56    def tearDown(cls):
57        ptc_setup._placefulTearDown()
58       
59
60class TestCase(ptc.PloneTestCase):
61    layer = Installed
62
63
64class TestCaseNotInstalled(ptc.PloneTestCase):
65    layer = NotInstalled
Note: See TracBrowser for help on using the repository browser.