source: products/quintagroup.plonegooglesitemaps/branches/sitemap_date/quintagroup/plonegooglesitemaps/tests/test_doctest.py @ 3565

Last change on this file since 3565 was 3506, checked in by potar, 12 years ago

fixed pep8

  • Property svn:eol-style set to native
File size: 992 bytes
Line 
1import unittest
2import doctest
3
4from base import FunctionalTestCase
5from Testing import ZopeTestCase as ztc
6from Products.CMFPlone.utils import _createObjectByType
7
8
9class 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
22def 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
33if __name__ == '__main__':
34    unittest.main(defaultTest='test_suite')
Note: See TracBrowser for help on using the repository browser.