Changeset 10875


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

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

File:
1 edited

Legend:

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

    r10570 r10875  
    3030from waeup.fceokene.testing import FunctionalLayer
    3131
     32session = datetime.now().year - 2
    3233
    3334class ApplicantUITest(FunctionalTestCase):
     
    5657        self.beccontainer = ApplicantsContainer()
    5758        self.beccontainer.mode = 'create'
    58         self.beccontainer.code = u'bec2011'
     59        self.beccontainer.code = u'bec%s' % session
    5960        self.beccontainer.prefix = u'bec'
    6061        self.beccontainer.application_category = u'bec'
    61         self.beccontainer.year = 2011
     62        self.beccontainer.year = session
    6263        self.beccontainer.application_fee = 300.0
    63         self.beccontainer.title = u'This is the bec2011 container'
    64         self.app['applicants']['bec2011'] = self.beccontainer
     64        self.beccontainer.title = u'This is the bec%s container' % session
     65        self.app['applicants'][self.beccontainer.code] = self.beccontainer
    6566        delta = datetime.timedelta(days=10)
    6667        self.beccontainer.startdate = datetime.datetime.now(pytz.utc) - delta
     
    7071        self.putmecontainer = ApplicantsContainer()
    7172        self.putmecontainer.mode = 'create'
    72         self.putmecontainer.code = u'putme2011'
     73        self.putmecontainer.code = u'putme%s' % session
    7374        self.putmecontainer.prefix = u'putme'
    7475        self.putmecontainer.application_category = u'bec' # doesn't matter
    75         self.putmecontainer.year = 2011
     76        self.putmecontainer.year = session
    7677        self.putmecontainer.application_fee = 300.0
    77         self.putmecontainer.title = u'This is the putme2011 container'
    78         self.app['applicants']['putme2011'] = self.putmecontainer
     78        self.putmecontainer.title = u'This is the putme%s container' % session
     79        self.app['applicants'][self.putmecontainer.code] = self.putmecontainer
    7980        delta = datetime.timedelta(days=10)
    8081        self.putmecontainer.startdate = datetime.datetime.now(pytz.utc) - delta
     
    9798        becapplicant.firstname = u'Anna'
    9899        becapplicant.lastname = u'Post'
    99         self.app['applicants']['bec2011'].addApplicant(becapplicant)
     100        self.app['applicants'][self.beccontainer.code].addApplicant(becapplicant)
    100101        self.becapplication_number = becapplicant.application_number
    101         self.becapplicant = self.app['applicants']['bec2011'][
     102        self.becapplicant = self.app['applicants'][self.beccontainer.code][
    102103            self.becapplication_number]
    103         self.becapplicant_path = ('http://localhost/app/applicants/bec2011/%s'
    104             % self.becapplication_number)
     104        self.becapplicant_path = ('http://localhost/app/applicants/bec%s/%s'
     105            % (session, self.becapplication_number))
    105106
    106107        putmeapplicant = createObject(u'waeup.Applicant')
    107108        putmeapplicant.firstname = u'Anna'
    108109        putmeapplicant.lastname = u'Post'
    109         self.app['applicants']['putme2011'].addApplicant(putmeapplicant)
     110        self.app['applicants'][self.putmecontainer.code].addApplicant(putmeapplicant)
    110111        self.putmeapplication_number = putmeapplicant.application_number
    111         self.putmeapplicant = self.app['applicants']['putme2011'][
     112        self.putmeapplicant = self.app['applicants'][self.putmecontainer.code][
    112113            self.putmeapplication_number]
    113         self.putmeapplicant_path = ('http://localhost/app/applicants/putme2011/%s'
    114             % self.putmeapplication_number)
     114        self.putmeapplicant_path = ('http://localhost/app/applicants/putme%s/%s'
     115            % (session, self.putmeapplication_number))
    115116
    116117        self.browser = Browser()
Note: See TracChangeset for help on using the changeset viewer.