1 | # Define a common SimpleBlogTestCase base class for use in all |
---|
2 | # SimpleBlog tests |
---|
3 | |
---|
4 | # Import the base test case classes |
---|
5 | from Testing import ZopeTestCase |
---|
6 | from Products.PloneTestCase import PloneTestCase |
---|
7 | |
---|
8 | # Make ZopeTestCase aware of the standard products |
---|
9 | |
---|
10 | # These install (or fail) quietly |
---|
11 | ZopeTestCase.installProduct('CMFCore', quiet=1) |
---|
12 | ZopeTestCase.installProduct('CMFDefault', quiet=1) |
---|
13 | ZopeTestCase.installProduct('CMFCalendar', quiet=1) |
---|
14 | ZopeTestCase.installProduct('CMFTopic', quiet=1) |
---|
15 | ZopeTestCase.installProduct('DCWorkflow', quiet=1) |
---|
16 | ZopeTestCase.installProduct('CMFHelpIcons', quiet=1) |
---|
17 | ZopeTestCase.installProduct('CMFQuickInstallerTool', quiet=1) |
---|
18 | ZopeTestCase.installProduct('CMFFormController', quiet=1) |
---|
19 | ZopeTestCase.installProduct('GroupUserFolder', quiet=1) |
---|
20 | ZopeTestCase.installProduct('ZCTextIndex', quiet=1) |
---|
21 | ZopeTestCase.installProduct('TextIndexNG2', quiet=1) |
---|
22 | ZopeTestCase.installProduct('SecureMailHost', quiet=1) |
---|
23 | ZopeTestCase.installProduct('CMFPlone') |
---|
24 | ZopeTestCase.installProduct('Archetypes') |
---|
25 | ZopeTestCase.installProduct('PortalTransforms', quiet=1) |
---|
26 | ZopeTestCase.installProduct('MimetypesRegistry', quiet=1) |
---|
27 | ZopeTestCase.installProduct('kupu', quiet=1) |
---|
28 | |
---|
29 | #These must install cleanly |
---|
30 | ZopeTestCase.installProduct('SimpleBlog') |
---|
31 | |
---|
32 | # Set up the Plone site used for the test fixture. The PRODUCTS are the products |
---|
33 | # to install in the Plone site (as opposed to the products defined above, which |
---|
34 | # are all products available to Zope in the test fixture) |
---|
35 | PRODUCTS = ['SimpleBlog'] |
---|
36 | PloneTestCase.setupPloneSite(products=PRODUCTS) |
---|
37 | |
---|
38 | |
---|
39 | class SimpleBlogTestCase(PloneTestCase.PloneTestCase): |
---|
40 | |
---|
41 | class Session(dict): |
---|
42 | def set(self, key, value): |
---|
43 | self[key] = value |
---|
44 | |
---|
45 | def _setup(self): |
---|
46 | PloneTestCase.PloneTestCase._setup(self) |
---|
47 | self.app.REQUEST['SESSION'] = self.Session() |
---|
48 | |
---|
49 | # You may wish to define additional helper methods |
---|
50 | # here that will be available in all tests. |
---|