Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testFileEditNone
def testImageEditNone
def testFileEditEmptyString
def testImageEditEmptyString
def testFileEditString
def testImageEditString
def testFileEditShortName
def testImageEditShortName
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Detailed Description

Definition at line 194 of file testContentTypeScripts.py.


Member Function Documentation

Definition at line 198 of file testContentTypeScripts.py.

00198 
00199     def afterSetUp(self):
00200         self.folder.invokeFactory('File', id='file', file=dummy.File())
00201         self.folder.invokeFactory('Image', id='image', file=dummy.Image())

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 216 of file testContentTypeScripts.py.

00216 
00217     def testFileEditEmptyString(self):
00218         self.assertEqual(str(self.folder.file), dummy.TEXT)
00219         self.folder.file.file_edit(file='', title='Foo')
00220         self.assertEqual(self.folder.file.Title(), 'Foo')
00221         # Data is not changed
00222         self.assertEqual(str(self.folder.file), dummy.TEXT)

Definition at line 202 of file testContentTypeScripts.py.

00202 
00203     def testFileEditNone(self):
00204         self.assertEqual(str(self.folder.file), dummy.TEXT)
00205         self.folder.file.file_edit(file=None, title='Foo')
00206         self.assertEqual(self.folder.file.Title(), 'Foo')
00207         # Data is not changed
00208         self.assertEqual(str(self.folder.file), dummy.TEXT)

Definition at line 238 of file testContentTypeScripts.py.

00238 
00239     def testFileEditShortName(self):
00240         transaction.savepoint(optimistic=True) # make rename work
00241         self.folder.file.file_edit(id='fred')
00242         self.failUnless('fred' in self.folder.objectIds())

Definition at line 230 of file testContentTypeScripts.py.

00230 
00231     def testFileEditString(self):
00232         self.folder.file.file_edit(file='foo')
00233         self.assertEqual(str(self.folder.file.getFile()), 'foo')

Definition at line 223 of file testContentTypeScripts.py.

00223 
00224     def testImageEditEmptyString(self):
00225         self.assertEqual(str(self.folder.image.data), dummy.GIF)
00226         self.folder.image.image_edit(file='', title='Foo')
00227         self.assertEqual(self.folder.image.Title(), 'Foo')
00228         # Data is not changed
00229         self.assertEqual(str(self.folder.image.data), dummy.GIF)

Definition at line 209 of file testContentTypeScripts.py.

00209 
00210     def testImageEditNone(self):
00211         self.assertEqual(str(self.folder.image.data), dummy.GIF)
00212         self.folder.image.image_edit(file=None, title='Foo')
00213         self.assertEqual(self.folder.image.Title(), 'Foo')
00214         # Data is not changed
00215         self.assertEqual(str(self.folder.image.data), dummy.GIF)

Definition at line 243 of file testContentTypeScripts.py.

00243 
00244     def testImageEditShortName(self):
00245         transaction.savepoint(optimistic=True) # make rename work
00246         self.folder.image.image_edit(id='fred')
00247         self.failUnless('fred' in self.folder.objectIds())
00248 

Definition at line 234 of file testContentTypeScripts.py.

00234 
00235     def testImageEditString(self):
00236         self.folder.image.image_edit(file=dummy.GIF)
00237         self.assertEqual(str(self.folder.image.data), dummy.GIF)


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