tests.py
1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import doctest
import unittest
from Testing import ZopeTestCase as ztc
from Products.Five import zcml
from Products.PloneTestCase import PloneTestCase as ptc
from Products.PloneTestCase.layer import PloneSite
from Products.PloneTestCase.layer import onsetup
import pf.biblioteca
OPTION_FLAGS = doctest.NORMALIZE_WHITESPACE | \
doctest.ELLIPSIS
ptc.setupPloneSite(products=['pf.biblioteca'])
class TestCase(ptc.PloneTestCase):
class layer(PloneSite):
@classmethod
def setUp(cls):
zcml.load_config('configure.zcml',
pf.biblioteca)
@classmethod
def tearDown(cls):
pass
def test_suite():
return unittest.TestSuite([
# Unit tests
#doctestunit.DocFileSuite(
# 'README.txt', package='pf.biblioteca',
# setUp=testing.setUp, tearDown=testing.tearDown),
#doctestunit.DocTestSuite(
# module='pf.biblioteca.mymodule',
# setUp=testing.setUp, tearDown=testing.tearDown),
# Integration tests that use PloneTestCase
ztc.ZopeDocFileSuite(
'INTEGRATION.txt',
package='pf.biblioteca',
optionflags = OPTION_FLAGS,
test_class=TestCase),
# -*- extra stuff goes here -*-
])
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')