Ignore:
Timestamp:
23 Apr 2014, 10:29:32 (11 years ago)
Author:
Henrik Bettermann
Message:

View and viewlet added which enable students to generate a matric number.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py

    r11596 r11597  
    1818import shutil
    1919import tempfile
     20import grok
     21from mechanize import LinkNotFoundError
    2022from hurry.workflow.interfaces import IWorkflowState
    2123from zope.component.hooks import setSite, clearSite
     
    332334        return
    333335
    334 
     336    def test_set_matric_number(self):
     337        # Login as student
     338        self.browser.open(self.login_path)
     339        #IWorkflowState(self.student).setState('school fee paid')
     340        self.browser.open(self.login_path)
     341        self.browser.getControl(name="form.login").value = self.student_id
     342        self.browser.getControl(name="form.password").value = 'spwd'
     343        self.browser.getControl("Login").click()
     344        self.assertRaises(
     345            LinkNotFoundError,
     346            self.browser.getLink, 'Get Matriculation Number')
     347        self.student.matric_number = None
     348        site = grok.getSite()
     349        site['configuration'].next_matric_integer = 1
     350        self.student['studycourse'].certificate.study_mode = 'ug_pt'
     351        self.browser.open(self.student_path)
     352        self.browser.getLink("Get Matriculation Number").click()
     353        self.assertTrue('Matriculation number PTP/fac1/dep1/04/00001 assigned.'
     354            in self.browser.contents)
     355        self.assertEqual(self.student.matric_number, 'PTP/fac1/dep1/04/00001')
     356        self.assertRaises(
     357            LinkNotFoundError,
     358            self.browser.getLink, 'Get Matriculation Number')
     359        return
     360
Note: See TracChangeset for help on using the changeset viewer.