Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testUploadBadFile
def testUploadBadImage
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Static Public Attributes

string file_id = 'File.2001-01-01.12345'
string image_id = 'Image.2001-01-01.12345'

Detailed Description

Definition at line 358 of file testContentTypeScripts.py.


Member Function Documentation

Definition at line 363 of file testContentTypeScripts.py.

00363 
00364     def afterSetUp(self):
00365         self.folder.invokeFactory('File', id=self.file_id)
00366         self.folder.invokeFactory('Image', id=self.image_id)
00367         transaction.savepoint(optimistic=True) # make rename work

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

00368 
00369     def testUploadBadFile(self):
00370         # http://dev.plone.org/plone/ticket/3416
00371         try:
00372             self.folder[self.file_id].file_edit(file=dummy.File('fred%.txt'))
00373         except CopyError:
00374             # Somehow we'd get one of these *sometimes* (not consistently)
00375             # when running tests... since all we're testing is that the
00376             # object doesn't get renamed, this shouldn't matter
00377             pass
00378         self.failIf('fred%.txt' in self.folder.objectIds())

Here is the call graph for this function:

Definition at line 379 of file testContentTypeScripts.py.

00379 
00380     def testUploadBadImage(self):
00381         # http://dev.plone.org/plone/ticket/3518
00382         try:
00383             self.folder[self.image_id].image_edit(file=dummy.File('fred%.gif'))
00384         except CopyError:
00385             # (ditto - see above)
00386             pass
00387         self.failIf('fred%.gif' in self.folder.objectIds())

Here is the call graph for this function:


Member Data Documentation

string CMFPlone.tests.testContentTypeScripts.TestBadFileIds.file_id = 'File.2001-01-01.12345' [static]

Definition at line 360 of file testContentTypeScripts.py.

string CMFPlone.tests.testContentTypeScripts.TestBadFileIds.image_id = 'Image.2001-01-01.12345' [static]

Definition at line 361 of file testContentTypeScripts.py.


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