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
19 from platecom.langview.config import *
20
21 import utils
22
23
24
25
26
27
28
29
30
31
32
33
34
35 ztc.installProduct('GenericSetup')
36 ztc.installProduct('PloneLanguageTool')
37 ztc.installProduct('LinguaPlone')
41 ztc.installProduct('Five')
42 fiveconfigure.debug_mode = True
43 zcml.load_config('configure.zcml', PACKAGE)
44 fiveconfigure.debug_mode = False
45
46
47
48 try:
49 from Products.Five import pythonproducts
50 pythonproducts.setupPythonProducts(None)
51
52
53
54 import App
55 App.ApplicationManager.ApplicationManager.Five=utils.Five
56
57
58
59
60
61
62
63 ztc.zopedoctest.functional.http=utils.http
64 except ImportError:
65
66 ztc.installPackage(PROJECTNAME)
67
68 setup_icsemantic.langfallback()
69
70 ptc.setupPloneSite(products=[PROJECTNAME,])
73 """We use this base class for all the tests in this package. If necessary,
74 we can put common utility or setup code in here. This applies to unit
75 test cases.
76 """
77
79 """We use this class for functional integration tests that use doctest
80 syntax. Again, we can put basic common utility or setup code in here.
81 """
89