Changeset 13992 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 26 Jun 2016, 05:35:30 (9 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r13991 r13992 1508 1508 class RefereeReportAddFormPage(KofaAddFormPage): 1509 1509 """Add-form to add an referee report. This form 1510 is protected by a mandate. (not yet ready)1510 is protected by a mandate. 1511 1511 """ 1512 1512 grok.context(IApplicant) … … 1515 1515 form_fields = grok.AutoFields( 1516 1516 IApplicantRefereeReport).omit('creation_date') 1517 grok.template('refereereportpage') 1517 1518 label = _('Add referee report') 1518 1519 pnav = 3 … … 1529 1530 # Check mandate 1530 1531 form = self.request.form 1531 mandate_id = form.get('mandate_id', None)1532 mandates = grok.getSite()['mandates']1533 mandate = mandates.get(mandate_id, None)1532 self.mandate_id = form.get('mandate_id', None) 1533 self.mandates = grok.getSite()['mandates'] 1534 mandate = self.mandates.get(self.mandate_id, None) 1534 1535 if mandate is None and not self.request.form.get('form.actions.submit'): 1535 1536 self.flash(_('No mandate.'), type='warning') … … 1558 1559 self.flash(_('Referee report has been saved. Thank you!')) 1559 1560 self.context.writeLogMessage(self, 'added: %s' % report.r_id) 1560 # XXX:Delete mandate1561 # XXX: Send email1561 # Delete mandate 1562 del self.mandates[self.mandate_id] 1562 1563 self.redirect(self.application_url()) 1563 1564 return -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r13991 r13992 1570 1570 container_name_1, self.applicant.application_number) 1571 1571 self.app['mandates'].addMandate(mandate) 1572 self.assertEqual(len(self.app['mandates'].keys()), 1) 1572 1573 # Let's open the add form page via the mandate view 1573 1574 self.browser.open('http://localhost/app/mandate?mandate_id=%s' 1574 1575 % mandate.mandate_id) 1576 self.assertTrue('Joan None' in self.browser.contents) 1577 # Report can't be saved without required fields 1578 self.browser.getControl(name="form.email").value = '' 1579 self.browser.getControl("Submit").click() 1580 self.assertTrue('Required input is missing' in self.browser.contents) 1581 self.browser.getControl(name="form.email").value = 'bb@bb.bb' 1575 1582 self.browser.getControl("Submit").click() 1576 1583 self.assertTrue('Referee report has been saved' in self.browser.contents) … … 1595 1602 in logcontent 1596 1603 ) 1604 # Mandate is deleted 1605 self.assertEqual(len(self.app['mandates'].keys()), 0)
Note: See TracChangeset for help on using the changeset viewer.