Ignore:
Timestamp:
8 Nov 2011, 20:44:12 (13 years ago)
Author:
uli
Message:

Remove obsolete imports and tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/branches/ulif-extimgstore/src/waeup/sirp/applicants/tests/test_applicant.py

    r7034 r7037  
    2323"""
    2424import grok
    25 import md5
    2625import unittest
    27 from StringIO import StringIO
    28 from hurry.file.interfaces import IFileRetrieval
    29 from zope.component import (
    30     provideAdapter, adapts, getGlobalSiteManager, provideUtility,
    31     queryUtility)
    32 from zope.component.hooks import setSite
     26from zope.component import adapts, queryUtility
    3327from zope.component.interfaces import IFactory
    3428from zope.interface import verify, implements
    3529from zope.location.interfaces import ILocation
    36 from zope.publisher.base import TestRequest
    37 from zope.publisher.interfaces import NotFound
    38 from waeup.sirp.app import University
    39 from waeup.sirp.image import WAeUPImageFile, createWAeUPImageFile
    4030from waeup.sirp.image.interfaces import IWAeUPImageFile
    4131from waeup.sirp.imagestorage import DefaultStorage
     
    4535    ApplicantImageStoreHandler, ApplicantImageNameChooser,
    4636    )
    47 from waeup.sirp.applicants.interfaces import (
    48     IResultEntry, IApplicant,
    49     )
    50 
    51 from waeup.sirp.testing import (FunctionalTestCase, FunctionalLayer)
     37from waeup.sirp.applicants.interfaces import IResultEntry, IApplicant
     38from waeup.sirp.testing import FunctionalTestCase, FunctionalLayer
    5239
    5340class FakeImageLocation(object):
     
    183170        return
    184171
    185     def DISABLEDtest_passport_no_site(self):
    186         # make sure we get a real image stored in passport attr
    187         image = self.applicant.passport.file.read()
    188         self.assertEqual(len(image), 2059)
    189         return
    190 
    191     def DISABLEDtest_passport_insite(self):
    192         # make sure we get a real image in passport attr when inside a site.
    193         # When an applicant is created 'inside a site', its passport
    194         # photograph should be put inside the images folder of the
    195         # site, even if it is only a placeholder.
    196         self.getRootFolder()['app'] = University()
    197         app = self.getRootFolder()['app']
    198         setSite(app)
    199         applicant = Applicant()
    200         image = self.applicant.passport.file.read()
    201         # The image is really the placeholder_m.jpg image
    202         self.assertEqual(len(image), 2059)
    203         self.assertEqual(md5.new(image).hexdigest(),
    204                          u'b48a1d39bbcb32e955d9ff2dea4ed0e6')
    205         # As the applicant has no reg_no yet, the image data is 'empty'
    206         self.assertEqual(self.applicant.passport.data,
    207                          '__img_appl__placeholder_m.jpg')
    208         # The image contains a file_id instead of real image-data
    209         self.assertEqual(self.applicant.passport.data,
    210                          u'b48a1d39bbcb32e955d9ff2dea4ed0e6-1')
    211         assert u'b48a1d39bbcb32e955d9ff2dea4ed0e6' in app['images'].keys()
    212         return
    213 
    214172class ApplicantFactoryTest(FunctionalTestCase):
    215173
Note: See TracChangeset for help on using the changeset viewer.