Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes
CMFCore.exportimport.tests.test_contenttyperegistry.importContentTypeRegistryTests Class Reference
Inheritance diagram for CMFCore.exportimport.tests.test_contenttyperegistry.importContentTypeRegistryTests:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.exportimport.tests.test_contenttyperegistry.importContentTypeRegistryTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_normal

Static Public Attributes

 layer = ExportImportZCMLLayer
list MAJOR_MINOR_ID = _TEST_PREDICATES[0]
list MAJOR = _TEST_PREDICATES[0]
list MINOR = _TEST_PREDICATES[0]
list MAJOR_MINOR_TYPENAME = _TEST_PREDICATES[0]
list EXTENSION_ID = _TEST_PREDICATES[1]
list EXTENSIONS = _TEST_PREDICATES[1]
list EXTENSION_TYPENAME = _TEST_PREDICATES[1]
list MIMETYPE_REGEX_ID = _TEST_PREDICATES[2]
list MIMETYPE_REGEX = _TEST_PREDICATES[2]
list MIMETYPE_REGEX_TYPENAME = _TEST_PREDICATES[2]
list NAME_REGEX_ID = _TEST_PREDICATES[3]
list NAME_REGEX = _TEST_PREDICATES[3]
list NAME_REGEX_TYPENAME = _TEST_PREDICATES[3]

Detailed Description

Definition at line 202 of file test_contenttyperegistry.py.


Member Function Documentation

Definition at line 206 of file test_contenttyperegistry.py.

00206 
00207     def test_normal(self):
00208         from Products.CMFCore.exportimport.contenttyperegistry \
00209                 import importContentTypeRegistry
00210 
00211         site = self._initSite(mit_predikat=False)
00212         ctr = site.content_type_registry
00213         self.assertEqual(len(ctr.listPredicates()), 0)
00214 
00215         context = DummyImportContext(site)
00216         context._files['contenttyperegistry.xml'] = self._WITH_POLICY_EXPORT
00217         importContentTypeRegistry(context)
00218 
00219         self.assertEqual(len(ctr.listPredicates()), len(_TEST_PREDICATES))
00220         predicate_id, (predicate, content_type_name) = ctr.listPredicates()[0]
00221         self.assertEqual(predicate_id, self.MAJOR_MINOR_ID)
00222         self.assertEqual(predicate.PREDICATE_TYPE, 'major_minor')
00223         self.assertEqual(content_type_name, self.MAJOR_MINOR_TYPENAME)
00224         self.assertEqual(predicate.major, self.MAJOR.split(','))
00225         self.assertEqual(predicate.minor, self.MINOR.split(','))
00226         predicate_id, (predicate, content_type_name) = ctr.listPredicates()[1]
00227         self.assertEqual(predicate_id, self.EXTENSION_ID)
00228         self.assertEqual(predicate.PREDICATE_TYPE, 'extension')
00229         self.assertEqual(content_type_name, self.EXTENSION_TYPENAME)
00230         self.assertEqual(predicate.extensions, self.EXTENSIONS.split(','))
00231         predicate_id, (predicate, content_type_name) = ctr.listPredicates()[2]
00232         self.assertEqual(predicate_id, self.MIMETYPE_REGEX_ID)
00233         self.assertEqual(predicate.PREDICATE_TYPE, 'mimetype_regex')
00234         self.assertEqual(content_type_name, self.MIMETYPE_REGEX_TYPENAME)
00235         self.assertEqual(predicate.pattern.pattern, self.MIMETYPE_REGEX)
00236         predicate_id, (predicate, content_type_name) = ctr.listPredicates()[3]
00237         self.assertEqual(predicate_id, self.NAME_REGEX_ID)
00238         self.assertEqual(predicate.PREDICATE_TYPE, 'name_regex')
00239         self.assertEqual(content_type_name, self.NAME_REGEX_TYPENAME)
00240         self.assertEqual(predicate.pattern.pattern, self.NAME_REGEX)
00241 

Here is the call graph for this function:


Member Data Documentation

Definition at line 99 of file test_contenttyperegistry.py.

Definition at line 101 of file test_contenttyperegistry.py.

Definition at line 100 of file test_contenttyperegistry.py.

Definition at line 204 of file test_contenttyperegistry.py.

Definition at line 96 of file test_contenttyperegistry.py.

Definition at line 95 of file test_contenttyperegistry.py.

Definition at line 98 of file test_contenttyperegistry.py.

Definition at line 103 of file test_contenttyperegistry.py.

Definition at line 102 of file test_contenttyperegistry.py.

Definition at line 104 of file test_contenttyperegistry.py.

Definition at line 97 of file test_contenttyperegistry.py.

Definition at line 106 of file test_contenttyperegistry.py.

Definition at line 105 of file test_contenttyperegistry.py.

Definition at line 107 of file test_contenttyperegistry.py.


The documentation for this class was generated from the following file: