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

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

fixed pep8

  • Property svn:eol-style set to native
File size: 992 bytes
RevLine 
[2946]1import unittest
2import doctest
3
[3163]4from base import FunctionalTestCase
5from Testing import ZopeTestCase as ztc
[2946]6from Products.CMFPlone.utils import _createObjectByType
7
[3152]8
[2946]9class DocTestCase(FunctionalTestCase):
10
11    def afterSetUp(self):
[2994]12        super(DocTestCase, self).afterSetUp()
[2946]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')
[3152]19        #return doc
[2946]20
[3152]21
[2946]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(),
[3152]29            optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS),
[3506]30        # | doctest.REPORT_ONLY_FIRST_FAILURE |
31    ])
[2946]32
33if __name__ == '__main__':
34    unittest.main(defaultTest='test_suite')
Note: See TracBrowser for help on using the repository browser.