Back to index

plone3  3.1.7
Public Member Functions
Archetypes.tests.test_update_schema.TestBasicSchemaUpdate Class Reference
Inheritance diagram for Archetypes.tests.test_update_schema.TestBasicSchemaUpdate:
Inheritance graph
[legend]
Collaboration diagram for Archetypes.tests.test_update_schema.TestBasicSchemaUpdate:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_update_preserves_mimetype

Detailed Description

Tests for update schema behavior which depend only on the basic
   types, and examine baseline behavior when no real schema changes have
   happened.

Definition at line 219 of file test_update_schema.py.


Member Function Documentation

Definition at line 224 of file test_update_schema.py.

00224 
00225     def test_update_preserves_mimetype(self):
00226         self.folder.invokeFactory('DDocument', 'mydoc', title="My Doc")
00227         doc = self.folder.mydoc
00228         doc.setBody("""
00229 An rst Document
00230 ===============
00231 
00232 * Which
00233 
00234   * has
00235 
00236   * some
00237 
00238 * bullet::
00239 
00240   points.
00241 
00242 * for testing""",  mimetype="text/restructured")
00243         doc.reindexObject()
00244         mimetype = doc.getField('body').getContentType(doc)
00245         self.assertEqual(mimetype, 'text/x-rst')
00246 
00247         # update schema for all DDocuments and check if our type is preserved
00248         request = HTTPRequest(sys.stdin,
00249                               {'SERVER_NAME':'test', 'SERVER_PORT': '8080'},
00250                               {})
00251         request.form['Archetypes.DDocument'] = True
00252         request.form['update_all'] = True
00253         self.portal.archetype_tool.manage_updateSchema(REQUEST=request)
00254         doc = self.folder.mydoc
00255         mimetype = doc.getField('body').getContentType(doc)
00256         self.assertEqual(mimetype, 'text/x-rst')
00257 
00258 


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