Changeset 18021 for main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests
- Timestamp:
- 13 Feb 2025, 11:36:26 (6 weeks ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r17261 r18021 1702 1702 self.browser.open(container_path) 1703 1703 self.browser.getLink("Export application data").click() 1704 self.browser.getControl(" Start new exports").click()1704 self.browser.getControl("Export all data").click() 1705 1705 job_ids = self.wait_for_export_jobs_completed() 1706 1706 # Three exports were created … … 1782 1782 'zope.mgr - applicants.browser.ExportJobContainerOverview ' 1783 1783 '- discarded: job_id=%s' % job_ids[2] in logcontent 1784 ) 1785 1786 def test_payments_in_container_export(self): 1787 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 1788 container_path = 'http://localhost/app/applicants/%s' % container_name_1 1789 self.browser.open(container_path) 1790 self.browser.getLink("Export application data").click() 1791 self.browser.getControl("Export payment data only").click() 1792 job_ids = self.wait_for_export_jobs_completed() 1793 # Three exports were created 1794 self.assertEqual(len(self.app['datacenter'].running_exports), 1) 1795 # When the job is finished and we reload the page... 1796 self.browser.open(container_path + '/exports') 1797 self.browser.getLink("Download", index=0).click() 1798 self.assertEqual(self.browser.headers['content-type'], 1799 'text/csv; charset=UTF-8') 1800 self.assertTrue( 1801 'filename="WAeUP.Kofa_applicantpayments_%s.csv' % job_ids[0] in 1802 self.browser.headers['content-disposition']) 1803 # Creation and downloading was logged 1804 logfile = os.path.join( 1805 self.app['datacenter'].storage, 'logs', 'datacenter.log') 1806 logcontent = open(logfile).read() 1807 self.assertTrue( 1808 'zope.mgr - applicants.browser.PaymentsExportJobContainerJobStart - ' 1809 'exported: applicantpayments (%s), job_id=%s' 1810 % (container_name_1, job_ids[0]) in logcontent 1811 ) 1812 self.assertTrue( 1813 'zope.mgr - applicants.browser.ExportJobContainerDownload - ' 1814 'downloaded: WAeUP.Kofa_applicantpayments_%s.csv, job_id=%s' 1815 % (job_ids[0], job_ids[0]) in logcontent 1784 1816 ) 1785 1817 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_export.py
r17766 r18021 22 22 from waeup.kofa.testing import KofaUnitTestLayer, FunctionalLayer 23 23 from waeup.kofa.utils.utils import KofaUtils 24 25 curr_year = datetime.datetime.now().year 24 26 25 27 class ApplicantsContainersExporterTest(unittest.TestCase): … … 319 321 def test_export_filtered(self): 320 322 self.applicant = self.setup_applicant(self.applicant) 323 cdate = str('%s#' % self.applicant['p120'].creation_date) 324 self.applicant['p120'].payment_date = datetime.datetime( 325 curr_year-6, 4, 1, 14, 12, 1) 321 326 exporter = ApplicantPaymentExporter() 322 327 exporter.export_filtered( 323 328 self.app, self.outfile, container=self.container.code) 324 329 result = open(self.outfile, 'rb').read() 325 cdate = str('%s#' % self.applicant['p120'].creation_date)326 330 self.assertEqual( 327 331 'ac,amount_auth,creation_date,p_category,p_combi,p_id,' 328 332 'p_item,p_session,p_state,payment_date,r_amount_approved,' 329 333 'r_code,r_desc,applicant_id,reg_number,display_fullname\r\n' 330 ',0.0,%s,application,[],p120,,2012,paid,,0.0,,,dp2011_654321,' 334 ',0.0,%s,application,[],p120,,2012,paid,2019-04-01 14:12:01#,0.0,' 335 ',,dp2011_654321,' 336 '123456,Anna M. Tester\r\n' % cdate, result) 337 exporter.export_filtered( 338 self.app, self.outfile, container=self.container.code, 339 p_start='03/02/2025', p_end='04/02/2025') 340 result = open(self.outfile, 'rb').read() 341 self.assertEqual( 342 'ac,amount_auth,creation_date,p_category,p_combi,p_id,' 343 'p_item,p_session,p_state,payment_date,r_amount_approved,' 344 'r_code,r_desc,applicant_id,reg_number,display_fullname\r\n', 345 result) 346 exporter.export_filtered( 347 self.app, self.outfile, container=self.container.code, 348 p_start='03/02/2019', p_end='04/05/2019') 349 result = open(self.outfile, 'rb').read() 350 self.assertEqual( 351 'ac,amount_auth,creation_date,p_category,p_combi,p_id,' 352 'p_item,p_session,p_state,payment_date,r_amount_approved,' 353 'r_code,r_desc,applicant_id,reg_number,display_fullname\r\n' 354 ',0.0,%s,application,[],p120,,2012,paid,2019-04-01 14:12:01#,0.0,' 355 ',,dp2011_654321,' 331 356 '123456,Anna M. Tester\r\n' % cdate, result) 332 357 return
Note: See TracChangeset for help on using the changeset viewer.