Ignore:
Timestamp:
31 Oct 2015, 06:25:49 (9 years ago)
Author:
Henrik Bettermann
Message:

Provide login credentials if student has already been created.

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

Legend:

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

    r13363 r13365  
    13681368            if applicant.state in (CREATED):
    13691369                self.created = True
     1370                self.student_id = applicant.student_id
     1371                self.password = applicant.application_number
    13701372            if applicant.state in (NOT_ADMITTED,):
    13711373                self.not_admitted = True
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicantcheckstatus.pt

    r13363 r13365  
    6969    <br />
    7070    <p i18n:translate="">
    71       Your student record has already been created for you. Please
    72       login and check your new student credentials.
     71      Your student record has already been created for you. Your new
     72      user name (= student id) is: <strong><span tal:replace="view/student_id">STUDENT_ID</span></strong>.
     73      Your initial password is: <strong><span tal:replace="view/password">PASSWORD</span></strong>.
     74      Please proceed to the <a tal:attributes="href python: view.url(layout.site, 'login')">login form</a>,
     75      enter your new login credentials and change your password immediately after login.
    7376    </p>
    7477  </tal:created>
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r13363 r13365  
    13921392        self.browser.getControl("Submit").click()
    13931393        self.assertTrue('No application record found' in self.browser.contents)
    1394         self.browser.getControl(name="unique_id").value = self.applicant.applicant_id
     1394        self.browser.getControl(
     1395          name="unique_id").value = self.applicant.applicant_id
    13951396        self.browser.getControl(name="lastname").value = 'nonsense'
    13961397        self.browser.getControl("Submit").click()
    13971398        self.assertTrue('No application record found' in self.browser.contents)
    1398         self.browser.getControl(name="unique_id").value = self.applicant.applicant_id
     1399        self.browser.getControl(
     1400          name="unique_id").value = self.applicant.applicant_id
    13991401        self.browser.getControl(name="lastname").value = 'Lion'
    14001402        self.browser.getControl("Submit").click()
    14011403        self.assertTrue('Application status of' in self.browser.contents)
    1402         self.assertTrue('You have not yet submitted your application' in self.browser.contents)
     1404        self.assertTrue(
     1405          'You have not yet submitted your application' in self.browser.contents)
    14031406        IWorkflowState(self.applicant).setState('admitted')
    14041407        self.browser.open('http://localhost/app/applicants/checkstatus')
    1405         self.browser.getControl(name="unique_id").value = self.applicant.applicant_id
    1406         # whitespaces are ignored
     1408        self.browser.getControl(
     1409          name="unique_id").value = self.applicant.applicant_id
     1410        # Whitespaces are ignored.
    14071411        self.browser.getControl(name="lastname").value = 'Lion'
    14081412        self.browser.getControl("Submit").click()
     
    14111415        self.applicant.course_admitted = self.certificate
    14121416        self.browser.open('http://localhost/app/applicants/checkstatus')
    1413         self.browser.getControl(name="unique_id").value = self.applicant.applicant_id
     1417        self.browser.getControl(
     1418          name="unique_id").value = self.applicant.applicant_id
    14141419        self.browser.getControl(name="lastname").value = 'Lion'
    14151420        self.browser.getControl("Submit").click()
    14161421        self.assertTrue('Congratulations!' in self.browser.contents)
    14171422        self.assertTrue('Unnamed Certificate (CERT1)' in self.browser.contents)
    1418         self.assertTrue('Department of Unnamed Department (dep1)' in self.browser.contents)
    1419         self.assertTrue('Faculty of Unnamed Faculty (NA)' in self.browser.contents)
    1420         # also the reg_number can be used
     1423        self.assertTrue(
     1424          'Department of Unnamed Department (dep1)' in self.browser.contents)
     1425        self.assertTrue(
     1426          'Faculty of Unnamed Faculty (NA)' in self.browser.contents)
     1427        # Also the reg_number can be used and page shows student id and password
     1428        # if applicant is in state created.
     1429        IWorkflowState(self.applicant).setState('created')
     1430        self.applicant.student_id = u'my id'
    14211431        self.browser.open('http://localhost/app/applicants/checkstatus')
    1422         self.browser.getControl(name="unique_id").value = self.applicant.reg_number
     1432        self.browser.getControl(
     1433          name="unique_id").value = self.applicant.reg_number
    14231434        self.browser.getControl(name="lastname").value = 'Lion'
    14241435        self.browser.getControl("Submit").click()
    14251436        self.assertTrue('Congratulations!' in self.browser.contents)
    14261437        self.assertTrue('Unnamed Certificate (CERT1)' in self.browser.contents)
    1427         self.assertTrue('Department of Unnamed Department (dep1)' in self.browser.contents)
    1428         self.assertTrue('Faculty of Unnamed Faculty (NA)' in self.browser.contents)
     1438        self.assertTrue('Department of Unnamed Department (dep1)'
     1439            in self.browser.contents)
     1440        self.assertTrue(
     1441          'Faculty of Unnamed Faculty (NA)' in self.browser.contents)
     1442        self.assertTrue('user name (= student id) is: <strong>my id</strong>'
     1443            in self.browser.contents)
     1444        self.assertTrue(
     1445          'password is: <strong>%s</strong>' % self.applicant.application_number
     1446          in self.browser.contents)
     1447       
    14291448
    14301449class ApplicantsExportTests(ApplicantsFullSetup, FunctionalAsyncTestCase):
Note: See TracChangeset for help on using the changeset viewer.