Changeset 13217 for main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests
- Timestamp:
- 24 Aug 2015, 06:34:28 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r13215 r13217 467 467 return 468 468 469 def test_prefill_container(self): 470 # Managers can pre-fill containers in create mode 471 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 472 self.prefill_path = self.container_path + '/prefill' 473 self.container_manage_path = self.container_path + '/@@manage' 474 self.browser.open(self.container_manage_path) 475 self.browser.getLink("Pre-fill").click() 476 self.assertEqual(self.browser.headers['Status'], '200 Ok') 477 self.assertEqual(self.browser.url, self.prefill_path) 478 self.browser.getControl(name="number").value = ['10'] 479 self.browser.getControl("Pre-fill").click() 480 self.assertTrue('10 application records created.' in self.browser.contents) 481 self.browser.open(self.container_manage_path) 482 self.assertTrue('This container contains 10 unused pre-filled records.' 483 in self.browser.contents) 484 self.assertEqual(self.applicantscontainer.counts[0], 11) 485 self.assertEqual(self.applicantscontainer.counts[1], 1) 486 # In update mode we can't pre-fill the container 487 self.applicantscontainer.mode = 'update' 488 self.browser.open(self.container_manage_path) 489 self.browser.getLink("Pre-fill").click() 490 self.assertTrue('Container must be in create mode to be pre-filled.' 491 in self.browser.contents) 492 self.browser.open(self.manage_root_path) 493 # Number of total records is 11 494 self.assertTrue('<td>11</td>' in self.browser.contents) 495 # The statistics have not changed 496 self.browser.open(self.container_path) 497 self.browser.getLink("Container statistics").click() 498 self.assertTrue('<td>1</td>' in self.browser.contents) 499 self.assertEqual(self.applicantscontainer.statistics[0], 500 {'not admitted': 0, 'started': 0, 'created': 0, 501 'admitted': 0, 'submitted': 0, 'initialized': 1, 'paid': 0}) 502 return 503 469 504 class ApplicantUITests(ApplicantsFullSetup): 470 505 # Tests for uploading/browsing the passport image of appplicants … … 1235 1270 uu_applicant = createObject('waeup.Applicant') 1236 1271 self.app['applicants'][container_name_1].addApplicant(uu_applicant) 1237 self.assert False(uu_applicant.record_used)1272 self.assertEqual(uu_applicant.container_code, container_name_1 + '-') 1238 1273 self.assertEqual(len(self.app['applicants'][container_name_1]), 2) 1239 1274 self.browser.open(self.container_path) … … 1251 1286 # ... and the existing, formerly unused record has been used instead 1252 1287 self.assertEqual(uu_applicant.lastname, 'Kurios') 1253 self.assert True(uu_applicant.record_used)1288 self.assertEqual(uu_applicant.container_code, container_name_1 + '+') 1254 1289 return 1255 1290
Note: See TracChangeset for help on using the changeset viewer.