From 2ceb4d1a393d3527ec11a74a7e8146f9ca8c6696 Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Thu, 4 May 2017 08:33:56 +0000 Subject: [PATCH] Bug 8612: QA followup - expand tests Test plan: prove t/db_dependent/Acquisition/GetBasketAsCSV.t --- t/db_dependent/Acquisition/GetBasketAsCSV.t | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Acquisition/GetBasketAsCSV.t b/t/db_dependent/Acquisition/GetBasketAsCSV.t index 4210d06..260bd85 100644 --- a/t/db_dependent/Acquisition/GetBasketAsCSV.t +++ b/t/db_dependent/Acquisition/GetBasketAsCSV.t @@ -4,7 +4,7 @@ use Modern::Perl; use CGI; -use Test::More tests => 2; +use Test::More tests => 3; use C4::Acquisition; use C4::Biblio; @@ -38,6 +38,13 @@ my $csv_profile = Koha::CsvProfile->new({ content => 'autor=biblio.author|title=biblio.title|quantity=aqorders.quantity', })->store; +my $csv_profile2 = Koha::CsvProfile->new({ + profile => 'my user profile', + type => 'export_basket', + csv_separator => ',', + content => 'biblio.author|title=biblio.title|quantity=aqorders.quantity', +})->store; + my $basketno; $basketno = NewBasket($vendor->id, 1); @@ -70,4 +77,9 @@ is($basket_csv2, 'Contract name,Order number,Entry date,ISBN,Author,Title,Public ', 'CSV should be generated with default template'); +my $basket_csv3 = C4::Acquisition::GetBasketAsCSV($basketno, $query, $csv_profile2->export_format_id); +is($basket_csv3, 'biblio.author,title,quantity +"King, Stephen","Test Record",3 +', 'CSV should be generated with user profile which does not have all headers defined'); + $schema->storage->txn_rollback(); -- 2.1.4