Back to index

plone3  3.1.7
Public Member Functions
CMFPlone.tests.testContentTypeScripts.TestEditFileKeepsMimeType Class Reference
Inheritance diagram for CMFPlone.tests.testContentTypeScripts.TestEditFileKeepsMimeType:
Inheritance graph
[legend]
Collaboration diagram for CMFPlone.tests.testContentTypeScripts.TestEditFileKeepsMimeType:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testFileMimeType
def testImageMimeType
def testFileEditKeepsMimeType
def testImageEditKeepsMimeType
def testFileRenameKeepsMimeType
def testImageRenameKeepsMimeType
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Detailed Description

Definition at line 249 of file testContentTypeScripts.py.


Member Function Documentation

Definition at line 253 of file testContentTypeScripts.py.

00253 
00254     def afterSetUp(self):
00255         self.folder.invokeFactory('File', id='file')
00256         self.folder.file.file_edit(file=dummy.File('foo.pdf'))
00257         self.folder.invokeFactory('Image', id='image')
00258         self.folder.image.image_edit(file=dummy.Image('foo.gif'))

Definition at line 30 of file PloneTestCase.py.

00030 
00031     def getAuthenticator(self):
00032         tag = AuthenticatorView('context', 'request').authenticator()
00033         pattern = '<input .*name="(\w+)".*value="(\w+)"'
00034         return match(pattern, tag).groups()

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.tests.PloneTestCase.PloneTestCase.setRequestMethod (   self,
  method 
) [inherited]
This is a stub now, but in case you want to try
   something fancy on Your Branch (tm), put it here.

Definition at line 26 of file PloneTestCase.py.

00026 
00027     def setRequestMethod(self, method):
00028         self.app.REQUEST.set('REQUEST_METHOD', method)
00029         self.app.REQUEST.method = method

Here is the caller graph for this function:

Definition at line 35 of file PloneTestCase.py.

00035 
00036     def setupAuthenticator(self):
00037         name, token = self.getAuthenticator()
00038         self.app.REQUEST.form[name] = token
00039 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 267 of file testContentTypeScripts.py.

00267 
00268     def testFileEditKeepsMimeType(self):
00269         self.assertEqual(self.folder.file.Format(), 'application/pdf')
00270         self.assertEqual(self.folder.file.getFile().content_type, 'application/pdf')
00271         self.folder.file.file_edit(title='Foo')
00272         self.assertEqual(self.folder.file.Title(), 'Foo')
00273         self.assertEqual(self.folder.file.Format(), 'application/pdf')
00274         self.assertEqual(self.folder.file.getFile().content_type, 'application/pdf')

Definition at line 259 of file testContentTypeScripts.py.

00259 
00260     def testFileMimeType(self):
00261         self.assertEqual(self.folder.file.Format(), 'application/pdf')
00262         self.assertEqual(self.folder.file.getFile().content_type, 'application/pdf')

Definition at line 283 of file testContentTypeScripts.py.

00283 
00284     def testFileRenameKeepsMimeType(self):
00285         self.assertEqual(self.folder.file.Format(), 'application/pdf')
00286         self.assertEqual(self.folder.file.getFile().content_type, 'application/pdf')
00287         transaction.savepoint(optimistic=True) # make rename work
00288         self.folder.file.file_edit(id='foo')
00289         self.assertEqual(self.folder.foo.Format(), 'application/pdf')
00290         self.assertEqual(self.folder.foo.getFile().content_type, 'application/pdf')

Definition at line 275 of file testContentTypeScripts.py.

00275 
00276     def testImageEditKeepsMimeType(self):
00277         self.assertEqual(self.folder.image.Format(), 'image/gif')
00278         self.assertEqual(self.folder.image.content_type, 'image/gif')
00279         self.folder.image.image_edit(title='Foo')
00280         self.assertEqual(self.folder.image.Title(), 'Foo')
00281         self.assertEqual(self.folder.image.Format(), 'image/gif')
00282         self.assertEqual(self.folder.image.content_type, 'image/gif')

Definition at line 263 of file testContentTypeScripts.py.

00263 
00264     def testImageMimeType(self):
00265         self.assertEqual(self.folder.image.Format(), 'image/gif')
00266         self.assertEqual(self.folder.image.content_type, 'image/gif')

Definition at line 291 of file testContentTypeScripts.py.

00291 
00292     def testImageRenameKeepsMimeType(self):
00293         self.assertEqual(self.folder.image.Format(), 'image/gif')
00294         self.assertEqual(self.folder.image.content_type, 'image/gif')
00295         transaction.savepoint(optimistic=True) # make rename work
00296         self.folder.image.image_edit(id='foo')
00297         self.assertEqual(self.folder.foo.Format(), 'image/gif')
00298         self.assertEqual(self.folder.foo.content_type, 'image/gif')
00299 


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