Back to index

plone3  3.1.7
attestcase.py
Go to the documentation of this file.
00001 from Testing import ZopeTestCase
00002 
00003 from Testing.ZopeTestCase.functional import Functional
00004 from Products.PloneTestCase import PloneTestCase
00005 
00006 # setup test content types
00007 from Products.GenericSetup import EXTENSION, profile_registry
00008 from Products.PloneTestCase.layer import ZCMLLayer
00009 
00010 profile_registry.registerProfile('Archetypes_sampletypes',
00011     'Archetypes Sample Content Types',
00012     'Extension profile including Archetypes sample content types',
00013     'profiles/sample_types',
00014     'Products.Archetypes',
00015     EXTENSION)
00016 
00017 # setup a Plone site
00018 from Products.PloneTestCase.ptc import setupPloneSite
00019 setupPloneSite(extension_profiles=['Products.Archetypes:Archetypes_sampletypes'
00020                                   ])
00021 
00022 # Fixup zope 2.7+ configuration
00023 from App import config
00024 config._config.rest_input_encoding = 'ascii'
00025 config._config.rest_output_encoding = 'ascii'
00026 config._config.rest_header_level = 3
00027 del config
00028 
00029 class ATTestCase(ZopeTestCase.ZopeTestCase):
00030     """Simple AT test case
00031     """
00032     layer = ZCMLLayer
00033 
00034 class ATFunctionalTestCase(Functional, ATTestCase):
00035     """Simple AT test case for functional tests
00036     """
00037     layer = ZCMLLayer
00038 
00039 from Testing.ZopeTestCase import user_name
00040 from Testing.ZopeTestCase import user_password
00041 default_user = user_name
00042 default_role = 'Member'
00043 
00044 __all__ = ('default_user', 'default_role', 'user_name', 'user_password',
00045            'ATTestCase', 'ATFunctionalTestCase', )