Bug 34845

Summary: GetBasketGroupAsCSV.t is failing if the DB has been upgraded
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Test SuiteAssignee: Jonathan Druart <jonathan.druart>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00
Bug Depends on: 28327, 34043    
Bug Blocks: 34841    
Attachments: Bug 34845: Fix GetBasketGroupAsCSV.t is CSVDelimiter is not ','

Description Jonathan Druart 2023-09-20 13:10:34 UTC
The syspref needs to be mocked, or the tests are failing.

To recreate:
root@kohadevbox:koha$ perl /kohadevbox/misc4dev/run_tests.pl --run-db-upgrade-only

kohadev-koha@kohadevbox:koha$ prove t/db_dependent/Acquisition/GetBasketGroupAsCSV.t
t/db_dependent/Acquisition/GetBasketGroupAsCSV.t .. 1/2 
#   Failed test 'CSV should be generated'
#   at t/db_dependent/Acquisition/GetBasketGroupAsCSV.t line 62.
#          got: '"Account number";"Basket name";"Order number";"Author";"Title";"Publisher";"Publication year";"Collection title";"ISBN";"Quantity";"RRP tax included";"RRP tax excluded";"Discount";"Estimated cost tax included";"Estimated cost tax excluded";"Note for vendor";"Entry date";"Bookseller name";"Bookseller physical address";"Bookseller postal address";"Contract number";"Contract name";"Basket group delivery place";"Basket group billing place";"Basket delivery place";"Basket billing place"# ;"";1;"King, Stephen";"Test Record";"";;"";;3;0.00;0.00;;0.00;0.00;"";2016-01-02;"my vendor";"vendor address";"";;"";"";"";"";""# '
#     expected: '"Account number","Basket name","Order number","Author","Title","Publisher","Publication year","Collection title","ISBN","Quantity","RRP tax included","RRP tax excluded","Discount","Estimated cost tax included","Estimated cost tax excluded","Note for vendor","Entry date","Bookseller name","Bookseller physical address","Bookseller postal address","Contract number","Contract name","Basket group delivery place","Basket group billing place","Basket delivery place","Basket billing place"# ,"",1,"King, Stephen","Test Record","",,"",,3,0.00,0.00,,0.00,0.00,"",2016-01-02,"my vendor","vendor address","",,"","","","",""# '

#   Failed test 'CSV should not fail if biblio does not exist'
#   at t/db_dependent/Acquisition/GetBasketGroupAsCSV.t line 73.
#          got: '"Account number";"Basket name";"Order number";"Author";"Title";"Publisher";"Publication year";"Collection title";"ISBN";"Quantity";"RRP tax included";"RRP tax excluded";"Discount";"Estimated cost tax included";"Estimated cost tax excluded";"Note for vendor";"Entry date";"Bookseller name";"Bookseller physical address";"Bookseller postal address";"Contract number";"Contract name";"Basket group delivery place";"Basket group billing place";"Basket delivery place";"Basket billing place"
# ;"";1;"";"";"";;"";;3;0.00;0.00;;0.00;0.00;"";2016-01-02;"my vendor";"vendor address";"";;"";"";"";"";""
# '
#     expected: '"Account number","Basket name","Order number","Author","Title","Publisher","Publication year","Collection title","ISBN","Quantity","RRP tax included","RRP tax excluded","Discount","Estimated cost tax included","Estimated cost tax excluded","Note for vendor","Entry date","Bookseller name","Bookseller physical address","Bookseller postal address","Contract number","Contract name","Basket group delivery place","Basket group billing place","Basket delivery place","Basket billing place"
# ,"",1,"","","",,"",,3,0.00,0.00,,0.00,0.00,"",2016-01-02,"my vendor","vendor address","",,"","","","",""
# '
# Looks like you failed 2 tests of 2.
Comment 1 Jonathan Druart 2023-09-22 12:37:44 UTC
Created attachment 156084 [details] [review]
Bug 34845: Fix GetBasketGroupAsCSV.t is CSVDelimiter is not ','
Comment 2 Tomás Cohen Arazi 2023-09-22 13:56:16 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 3 Fridolin Somers 2023-09-22 19:24:24 UTC
Depends on Bug 34043 not in 23.05.x