1 """Test setup for integration and functional tests.
2
3 When we import PloneTestCase and then call setupPloneSite(), all of Plone's
4 products are loaded, and a Plone site will be created. This happens at module
5 level, which makes it faster to run each test, but slows down test runner
6 startup.
7 """
8 import os, sys
9 from App import Common
10
11 from Products.Five import zcml
12 from Products.Five import fiveconfigure
13
14 from Testing import ZopeTestCase as ztc
15
16 from Products.PloneTestCase import PloneTestCase as ptc
17 from Products.PloneTestCase.layer import onsetup
18 from Products.PloneTestCase.layer import ZCMLLayer
19
20 from platecom.utils.config import *
21
22 import utils
23
24
25
26
27
28
29
30
31
32
33
34
35
36 ztc.installProduct('GenericSetup')
37 ztc.installProduct('PloneLanguageTool')
38 ztc.installProduct('LinguaPlone')
42 ztc.installProduct('Five')
43 fiveconfigure.debug_mode = True
44 zcml.load_config('configure.zcml', PACKAGE)
45 fiveconfigure.debug_mode = False
46
47
48
49 try:
50 from Products.Five import pythonproducts
51 pythonproducts.setupPythonProducts(None)
52
53
54
55 import App
56 App.ApplicationManager.ApplicationManager.Five=utils.Five
57
58
59
60
61
62
63
64 ztc.zopedoctest.functional.http=utils.http
65 except ImportError:
66
67 ztc.installPackage(PROJECTNAME)
68
69 setup_iccommunity.core()
70
71 ptc.setupPloneSite(products=[PROJECTNAME,])
74 """We use this base class for all the tests in this package. If necessary,
75 we can put common utility or setup code in here. This applies to unit
76 test cases.
77 """
78
81 """We use this class for functional integration tests that use doctest
82 syntax. Again, we can put basic common utility or setup code in here.
83 """
91