1 | import unittest |
---|
2 | import doctest |
---|
3 | |
---|
4 | from base import FunctionalTestCase |
---|
5 | from Testing import ZopeTestCase as ztc |
---|
6 | from Products.CMFPlone.utils import _createObjectByType |
---|
7 | |
---|
8 | |
---|
9 | class DocTestCase(FunctionalTestCase): |
---|
10 | |
---|
11 | def afterSetUp(self): |
---|
12 | super(DocTestCase, self).afterSetUp() |
---|
13 | #self.createTestContent() |
---|
14 | |
---|
15 | def addDocument(self, cont, id, text): |
---|
16 | doc = _createObjectByType('Document', cont, id=id) |
---|
17 | doc.edit(text_format='plain', text=text) |
---|
18 | self.workflow.doActionFor(doc, 'publish') |
---|
19 | #return doc |
---|
20 | |
---|
21 | |
---|
22 | def test_suite(): |
---|
23 | return unittest.TestSuite([ |
---|
24 | |
---|
25 | # Demonstrate the main content types |
---|
26 | ztc.FunctionalDocFileSuite( |
---|
27 | 'filters.txt', package='quintagroup.plonegooglesitemaps', |
---|
28 | test_class=DocTestCase, globs=globals(), |
---|
29 | optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS), |
---|
30 | # | doctest.REPORT_ONLY_FIRST_FAILURE | |
---|
31 | ]) |
---|
32 | |
---|
33 | if __name__ == '__main__': |
---|
34 | unittest.main(defaultTest='test_suite') |
---|