Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
Archetypes.tests.test_fields.DownloadTest Class Reference
Inheritance diagram for Archetypes.tests.test_fields.DownloadTest:
Inheritance graph
[legend]
Collaboration diagram for Archetypes.tests.test_fields.DownloadTest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def test_download_from_textfield
def test_download_filename_encoding

Public Attributes

 dummy
 field
 wordfile
 request
 response

Detailed Description

Definition at line 343 of file test_fields.py.


Member Function Documentation

Definition at line 345 of file test_fields.py.

00345 
00346     def afterSetUp(self):
00347         # Set up a content object with a field that has a word
00348         # document in it
00349         ATSiteTestCase.afterSetUp(self)
00350         self.dummy = mkDummyInContext(
00351             Dummy, oid='dummy', context=self.portal, schema=schema)
00352         self.field = self.dummy.getField('textfield')
00353         ptpath = PortalTransforms.__path__[0]
00354         self.wordfile = open('%s/tests/input/test.doc' % ptpath)
00355         self.field.getMutator(self.dummy)(self.wordfile.read())
00356         self.request = self.app.REQUEST
00357         self.response = self.request.response
    

Definition at line 364 of file test_fields.py.

00364 
00365     def test_download_filename_encoding(self):
00366         # When downloading, the filename is converted to ASCII:
00367         self.field.setFilename(self.dummy, '\xc3\xbcberzeugen')
00368         self.field.download(self.dummy, no_output=True)
00369         self.assertEqual(self.response.headers['content-disposition'],
00370                          'attachment; filename="uberzeugen"')
        

Definition at line 358 of file test_fields.py.

00358 
00359     def test_download_from_textfield(self):
00360         # make sure field data doesn't get transformed when using the
00361         # download method
00362         value = self.field.download(self.dummy, no_output=True)
00363         self.failIf(isinstance(value, str))


Member Data Documentation

Definition at line 349 of file test_fields.py.

Definition at line 351 of file test_fields.py.

Definition at line 355 of file test_fields.py.

Definition at line 356 of file test_fields.py.

Definition at line 353 of file test_fields.py.


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