Ignore:
Timestamp:
4 Dec 2011, 07:56:39 (13 years ago)
Author:
Henrik Bettermann
Message:

Let's generate the applicant_id only when the applicant is added to its container to be compliant with the generic batch processor (importer).

Location:
main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_applicant.py

    r7255 r7260  
    123123        # we can get an image filename for applicants not in a container
    124124        appl = Applicant()
     125        appl.applicant_id = u'dummy_123456'
    125126        chooser = IFileStoreNameChooser(appl)
    126127        result = chooser.chooseName()
    127128        # the file would be stored in a ``_default`` directory.
    128129        self.assertEqual(
    129             result, '__img-applicant___default/xxx_1234.jpg')
     130            result, '__img-applicant___default/dummy_123456.jpg')
    130131        return
    131132
     
    134135        fake_container.__name__ = 'folder'
    135136        fake_container.code = 'folder'
    136         appl = Applicant(container=fake_container)
     137        appl = Applicant()
     138        appl.applicant_id = u'folder_123456'
    137139        appl.__parent__ = fake_container
    138140        chooser = IFileStoreNameChooser(appl)
     
    147149        fake_container.__name__ = 'folder'
    148150        fake_container.code = 'folder'
    149         appl = Applicant(container=fake_container)
     151        appl = Applicant()
     152        appl.applicant_id = u'folder_123456'
    150153        appl.__parent__ = fake_container
    151154        chooser = IFileStoreNameChooser(appl)
     
    193196
    194197    def test_factory(self):
    195         obj = self.factory(container=None)
     198        obj = self.factory()
    196199        assert isinstance(obj, Applicant)
    197200
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_browser.py

    r7259 r7260  
    117117
    118118        # Add an applicant
    119         self.applicant = Applicant(container=applicantscontainer)
    120         app['applicants']['app2009'][
    121             self.applicant.application_number] = self.applicant
     119        self.applicant = Applicant()
     120        app['applicants']['app2009'].addApplicant(self.applicant)
    122121        IUserAccount(
    123122            self.app['applicants']['app2009'][
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_catalog.py

    r7240 r7260  
    6161        setSite(self.app)
    6262        self.app['applicants']['mystuff'] = self.container
    63         self.applicant = Applicant(container=self.container)
    64         self.app['applicants']['mystuff'][
    65             self.applicant.application_number] = self.applicant
     63        self.applicant = Applicant()
     64        self.app['applicants']['mystuff'].addApplicant(self.applicant)
    6665        return
    6766
Note: See TracChangeset for help on using the changeset viewer.