Changeset 12394 for main


Ignore:
Timestamp:
4 Jan 2015, 16:09:45 (10 years ago)
Author:
Henrik Bettermann
Message:

Make tests work for the next two years.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/applicants
Files:
4 edited

Legend:

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

    r11615 r12394  
    165165        notify(grok.ObjectModifiedEvent(student))
    166166        # Save application slip
    167         self._createApplicationPDF(student, view=view)
    168 
    169         return True, _('Student ${a} created', mapping = {'a':student.student_id})
     167        try:
     168            self._createApplicationPDF(student, view=view)
     169            return True, _('Student ${a} created', mapping = {'a':student.student_id})
     170        except IOError:
     171            return False, _('IOError: Application Slip could not be created.')
    170172
    171173    def _createApplicationPDF(self, student, view=None):
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/sample_container_data.csv

    r8314 r12394  
    11code,title,prefix,year,application_category,description,startdate,enddate,strict_deadline,mode
    2 app2012,General Studies 2012/2013,app,2012,basic,"This text can been seen by anonymous users.
     2app2014,General Studies,app,2014,basic,"This text can been seen by anonymous users.
    33>>de<<
    44Dieser Text kann von anonymen Benutzern gelesen werden.",2012-03-01,2012-04-25,1,create
    5 app2013,General Studies 2013/2014,app,2012,basic,"This text can been seen by anonymous users.
     5app2015,General Studies,app,2015,basic,"This text can been seen by anonymous users.
    66>>de<<
    77Dieser Text kann von anonymen Benutzern gelesen werden.",2013-03-01,2013-04-25,1,create
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py

    r10613 r12394  
    151151            self.csv_file, APPS_CONTAINER_HEADER_FIELDS)
    152152        avail_containers = [x for x in self.app['applicants'].keys()]
    153         container = self.app['applicants'].get('app2012', None)
    154         container2 = self.app['applicants'].get('app2013', None)
     153        container = self.app['applicants'].get('app2014', None)
     154        container2 = self.app['applicants'].get('app2015', None)
    155155        self.assertTrue(container is not None)
    156156        self.assertTrue(container2 is not None)
    157157
    158158        # check attributes
    159         self.assertEqual(container.code, u'app2012')
    160         self.assertEqual(container.title, u'General Studies 2012/2013')
     159        self.assertEqual(container.code, u'app2014')
     160        self.assertEqual(container.title, u'General Studies')
    161161        self.assertEqual(container.prefix, u'app')
    162         self.assertEqual(container.year, 2012)
     162        self.assertEqual(container.year, 2014)
    163163        self.assertEqual(container.application_category, 'basic')
    164164        self.assertEqual(
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_export.py

    r12079 r12394  
    4949    def setup_container(self, container):
    5050        # set all attributes of a container
    51         container.code = u'dp2012'
    52         container.title = u'General Studies 2012/13'
     51        container.code = u'dp2015'
     52        container.title = u'General Studies'
    5353        container.prefix = list(ApplicationTypeSource()(container))[0]
    54         container.year = 2012
     54        container.year = 2015
    5555        container.application_category = list(AppCatSource()(container))[0]
    5656        container.description = u'Some Description\nwith linebreak\n'
    5757        container.description += u'<<de>>man spriht deutsh'
    5858        container.startdate = datetime.datetime(
    59             2012, 1, 1, 12, 0, 0, tzinfo=pytz.utc)
     59            2015, 1, 1, 12, 0, 0, tzinfo=pytz.utc)
    6060        container.enddate = datetime.datetime(
    61             2012, 1, 31, 23, 0, 0, tzinfo=pytz.utc)
     61            2015, 1, 31, 23, 0, 0, tzinfo=pytz.utc)
    6262        return container
    6363
     
    7474            'enddate,hidden,mode,prefix,startdate,strict_deadline,title,year\r\n'
    7575
    76             'basic,0.0,,dp2012,'
     76            'basic,0.0,,dp2015,'
    7777            '"Some Description\nwith linebreak\n<<de>>man spriht deutsh",'
    78             '2012-01-31 23:00:00+00:00#,0,,app,2012-01-01 12:00:00+00:00#,1,'
    79             'General Studies 2012/13,2012\r\n'
     78            '2015-01-31 23:00:00+00:00#,0,,app,2015-01-01 12:00:00+00:00#,1,'
     79            'General Studies,2015\r\n'
    8080            )
    8181        return
Note: See TracChangeset for help on using the changeset viewer.