Ignore:
Timestamp:
7 Jan 2014, 07:32:50 (11 years ago)
Author:
Henrik Bettermann
Message:

Make tests turn-of-the-year-resistant.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r10845 r10874  
    225225        self.browser.open(self.root_path)
    226226        self.assertTrue(
    227             '<a href="http://localhost/app/applicants/app2011">'
    228             'This is the app2011 container</a>' in self.browser.contents)
    229         self.app['applicants']['app2011'].hidden = True
     227            '<a href="http://localhost/app/applicants/%s">'
     228            'This is the %s container</a>' % (container_name_1, container_name_1)
     229            in self.browser.contents)
     230        self.app['applicants'][container_name_1].hidden = True
    230231        self.browser.open(self.root_path)
    231232        # Anonymous users can't see hidden containers
    232233        self.assertFalse(
    233             '<a href="http://localhost/app/applicants/app2011">'
    234             'This is the app2011 container</a>' in self.browser.contents)
     234            '<a href="http://localhost/app/applicants/%s">'
     235            'This is the %s container</a>' % (container_name_1, container_name_1)
     236            in self.browser.contents)
    235237        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    236238        self.browser.open(self.root_path)
    237239        self.assertTrue(
    238             '<a href="http://localhost/app/applicants/app2011">'
    239             'This is the app2011 container</a>' in self.browser.contents)
     240            '<a href="http://localhost/app/applicants/%s">'
     241            'This is the %s container</a>' % (container_name_1, container_name_1)
     242            in self.browser.contents)
    240243        return
    241244
     
    339342        self.browser.getControl("Add applicants container").click()
    340343        self.assertTrue('Added:' in self.browser.contents)
    341         self.browser.getLink("app2011").click()
     344        self.browser.getLink(container_name_1).click()
    342345        self.assertTrue('Manage applicants container'
    343346            in self.browser.contents)
     
    402405        self.assertTrue(
    403406            'zope.mgr - applicants.browser.ApplicantsContainerManageFormPage - '
    404             'app2011 - saved: application_fee\n' in logcontent)
     407            '%s - saved: application_fee\n' % container_name_1 in logcontent)
    405408        self.browser.getControl("Remove selected", index=0).click()
    406409        self.assertTrue('No applicant selected' in self.browser.contents)
     
    703706        self.assertEqual(file_len, 31)
    704707        # When an applicant is removed, also the image is gone.
    705         del self.app['applicants']['app2011'][self.applicant.application_number]
     708        del self.app['applicants'][container_name_1][self.applicant.application_number]
    706709        fd = storage.getFile(file_id)
    707710        self.assertTrue(fd is None)
     
    12381241    def test_applicants_in_container_export(self):
    12391242        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    1240         container_path = 'http://localhost/app/applicants/app2011'
     1243        container_path = 'http://localhost/app/applicants/%s' % container_name_1
    12411244        self.browser.open(container_path)
    12421245        self.browser.getLink("Export applicants").click()
     
    12651268        self.assertTrue(
    12661269            'zope.mgr - applicants.browser.ExportJobContainerJobStart - '
    1267             'exported: applicants (app2011), job_id=%s'
    1268             % job_id in logcontent
     1270            'exported: applicants (%s), job_id=%s'
     1271            % (container_name_1, job_id) in logcontent
    12691272            )
    12701273        self.assertTrue(
Note: See TracChangeset for help on using the changeset viewer.