Changeset 7983 for main/waeup.kofa


Ignore:
Timestamp:
26 Mar 2012, 09:31:08 (13 years ago)
Author:
Henrik Bettermann
Message:

Remove unneeded default values in interfaces. Adjust tests.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py

    r7951 r7983  
    177177        title = _(u'Sex'),
    178178        source = GenderSource(),
    179         default = u'm',
    180179        required = True,
    181180        )
     
    190189    matric_number = TextLineChoice(
    191190        title = _(u'Matriculation Number'),
    192         #default = u'',
    193191        required = False,
    194192        readonly = False,
     
    198196    adm_code = schema.TextLine(
    199197        title = _(u'PWD Activation Code'),
    200         default = u'',
    201198        required = False,
    202199        readonly = True,
     
    230227    clr_code = schema.TextLine(
    231228        title = _(u'CLR Activation Code'),
    232         default = u'',
    233229        required = False,
    234230        readonly = True,
     
    239235        title = _(u'Nationality'),
    240236        default = 'nigeria',
    241         required = True,
     237        required = False,
    242238        )
    243239
     
    262258    reg_number = schema.TextLine(
    263259        title = _(u'Registration Number'),
    264         default = None,
    265260        required = False,
    266261        )
     
    272267    matric_number = schema.TextLine(
    273268        title = _(u'Matriculation Number'),
    274         default = None,
    275269        required = False,
    276270        )
     
    283277        title = _(u'Certificate'),
    284278        source = CertificateSource(),
    285         default = None,
    286279        required = False,
    287280        )
     
    290283        title = _(u'Entry Mode'),
    291284        source = StudyModeSource(),
    292         default = u'ug_ft',
    293285        required = True,
    294286        readonly = False,
     
    299291        source = academic_sessions_vocab,
    300292        #default = datetime.now().year,
    301         default = None,
    302293        required = True,
    303294        readonly = False,
     
    307298        title = _(u'Current Session'),
    308299        source = academic_sessions_vocab,
    309         default = None,
    310300        required = True,
    311301        readonly = False,
     
    315305        title = _(u'Current Level'),
    316306        source = StudyLevelSource(),
    317         default = None,
    318307        required = False,
    319308        readonly = False,
     
    348337        title = _(u'Current Session'),
    349338        source = academic_sessions_vocab,
    350         default = None,
    351339        required = True,
    352340        )
     
    355343        title = _(u'Current Level'),
    356344        source = StudyLevelSource(),
    357         default = None,
    358345        required = True,
    359346        )
     
    370357        title = _(u'Session'),
    371358        source = academic_sessions_vocab,
    372         default = None,
    373359        required = True,
    374360        )
     
    452438    bed_coordinates = schema.TextLine(
    453439        title = _(u'Bed Coordinates'),
    454         default = None,
    455440        required = False,
    456441        readonly = False,
     
    459444    bed_type = schema.TextLine(
    460445        title = _(u'Bed Type'),
    461         default = None,
    462446        required = False,
    463447        readonly = False,
     
    467451        title = _(u'Session'),
    468452        source = academic_sessions_vocab,
    469         default = None,
    470453        required = True,
    471454        readonly = True,
     
    480463    booking_code = schema.TextLine(
    481464        title = _(u'Booking Activation Code'),
    482         default = u'',
    483465        required = False,
    484466        readonly = True,
     
    515497    reg_number = schema.TextLine(
    516498        title = _(u'Registration Number'),
    517         default = None,
    518499        required = True,
    519500        readonly = False,
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_student_data.csv

    r7952 r7983  
    1 student_id,firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,reg_state
    2 X666666,Aaren,Pieri,1,1990-01-02,100000,aa@aa.ng,1234,courses validated
    3 ,Aaren,Finau,2,1990-01-03,100001,aa@aa.ng,1234,courses validated
    4 ,Aaren,Berson,3,1990-01-04,100002,aa@aa.ng,1234,courses validated
    5 ,Else,Mueller,4,1990-01-05,100003,aa@aa.ng,1234,courses registered
     1student_id,firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,sex,reg_state
     2X666666,Aaren,Pieri,1,1990-01-02,100000,aa@aa.ng,1234,m,courses validated
     3,Aaren,Finau,2,1990-01-03,100001,aa@aa.ng,1234,m,courses validated
     4,Aaren,Berson,3,1990-01-04,100002,aa@aa.ng,1234,m,courses validated
     5,Else,Mueller,4,1990-01-05,100003,aa@aa.ng,1234,f,courses registered
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_student_data_migration.csv

    r7527 r7983  
    1 student_id,firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,password,reg_state
    2 A123456,Aaren,Pieri,1,1990-01-02#,100000,aa@aa.ng,1234,mypw1,clearance started
    3 B123456,Aaren,Finau,2,1990-01-03,100001,aa@aa.ng,1234,mypw1,cleared
    4 C123456,Aaren,Berson,3,1990-01-04,100002,aa@aa.ng,1234,mypw1,admitted
    5 D123456,John,Wolter,4,1990-01-05,100003,aa@aa.ng,1234,mypw1,nonsense
    6 E123456,John,Kennedy,5,1990-01-06,100004,aa@aa.ng,1234,
     1student_id,firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,password,sex,reg_state
     2A123456,Aaren,Pieri,1,1990-01-02#,100000,aa@aa.ng,1234,mypw1,m,clearance started
     3B123456,Aaren,Finau,2,1990-01-03,100001,aa@aa.ng,1234,mypw1,m,cleared
     4C123456,Aaren,Berson,3,1990-01-04,100002,aa@aa.ng,1234,mypw1,m,admitted
     5D123456,John,Wolter,4,1990-01-05,100003,aa@aa.ng,1234,mypw1,m,nonsense
     6E123456,John,Kennedy,5,1990-01-06,100004,aa@aa.ng,1234,,x
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py

    r7958 r7983  
    277277        self.assertEqual(num_warns,2)
    278278        assert len(self.app['students'].keys()) == 4
     279        content = open(fail_file).read()
     280        self.assertEqual(
     281            content,
     282            'reg_number,firstname,student_id,sex,email,phone,date_of_birth,reg_state,lastname,password,matric_number,--ERRORS--\r\n'
     283            '4,John,D123456,m,aa@aa.ng,1234,1990-01-05,nonsense,Wolter,mypw1,100003,reg_state: not allowed\r\n'
     284            '5,John,E123456,x,aa@aa.ng,1234,1990-01-06,,Kennedy,,100004,sex: Invalid value; reg_state: not allowed\r\n'
     285            )
    279286        self.assertTrue('A123456' in self.app['students'].keys())
    280287        self.assertEqual(self.app['students']['A123456'].state,'clearance started')
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r7982 r7983  
    618618        self.browser.getControl(name="form.current_session").value = ['2004']
    619619        self.browser.getControl(name="form.current_verdict").value = ['A']
     620        self.browser.getControl(name="form.entry_mode").value = ['ug_ft']
    620621        self.browser.getControl("Save").click()
    621622        # Now we can save also the current level which depends on start and end
     
    725726        # Prepare a csv file for students
    726727        open('students.csv', 'wb').write(
    727 """firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,password
    728 Aaren,Pieri,1,1990-01-02,100000,aa@aa.ng,1234,mypwd1
    729 Claus,Finau,2,1990-01-03,100001,aa@aa.ng,1234,mypwd1
    730 Brit,Berson,3,1990-01-04,100001,aa@aa.ng,1234,mypwd1
     728"""firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,sex,password
     729Aaren,Pieri,1,1990-01-02,100000,aa@aa.ng,1234,m,mypwd1
     730Claus,Finau,2,1990-01-03,100001,aa@aa.ng,1234,m,mypwd1
     731Brit,Berson,3,1990-01-04,100001,aa@aa.ng,1234,m,mypwd1
    731732""")
    732733        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
Note: See TracChangeset for help on using the changeset viewer.