Bugzilla – Attachment 170504 Details for
Bug 35026
Refactor addorderiso2709.pl to use object methods
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35026: (follow-up) Create data for tests and do not rely on state of DB
Bug-35026-follow-up-Create-data-for-tests-and-do-n.patch (text/plain), 3.50 KB, created by
Nick Clemens (kidclamp)
on 2024-08-20 18:55:14 UTC
(
hide
)
Description:
Bug 35026: (follow-up) Create data for tests and do not rely on state of DB
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-08-20 18:55:14 UTC
Size:
3.50 KB
patch
obsolete
>From d9ce7620f6f9e0b264f41c1e2bf5bee55ca50253 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 20 Aug 2024 18:54:50 +0000 >Subject: [PATCH] Bug 35026: (follow-up) Create data for tests and do not rely > on state of DB > >--- > t/db_dependent/Koha/MarcOrder.t | 34 +++++++++++++++++++++++++-------- > 1 file changed, 26 insertions(+), 8 deletions(-) > >diff --git a/t/db_dependent/Koha/MarcOrder.t b/t/db_dependent/Koha/MarcOrder.t >index 91b95b2486d..4bcb90f9373 100755 >--- a/t/db_dependent/Koha/MarcOrder.t >+++ b/t/db_dependent/Koha/MarcOrder.t >@@ -242,6 +242,9 @@ subtest 'add_items_from_import_record() - addorderiso2709.pl' => sub { > > $schema->storage->txn_begin; > >+ my $branch = $builder->build_object( { class => 'Koha::Libraries' } ); >+ my $branchcode = $branch->branchcode; >+ > my $bpid = C4::Budgets::AddBudgetPeriod( > { > budget_period_startdate => '2008-01-01', budget_period_enddate => '2008-12-31' >@@ -271,7 +274,7 @@ subtest 'add_items_from_import_record() - addorderiso2709.pl' => sub { > my $sample_import_batch = { > matcher_id => 1, > template_id => 1, >- branchcode => 'CPL', >+ branchcode => $branchcode, > overlay_action => 'create_new', > nomatch_action => 'create_new', > item_action => 'always_add', >@@ -317,6 +320,18 @@ subtest 'add_items_from_import_record() - addorderiso2709.pl' => sub { > } > )->store; > >+ my $basket = $builder->build_object( >+ { >+ class => "Koha::Acquisition::Baskets", >+ value => { >+ booksellerid => $bookseller->id, >+ create_items => 'ordering', >+ is_standing => 0, >+ closedate => undef >+ } >+ } >+ ); >+ > my $client_item_fields = { > 'notforloans' => [ > '', >@@ -349,16 +364,16 @@ subtest 'add_items_from_import_record() - addorderiso2709.pl' => sub { > '' > ], > 'homebranches' => [ >- 'CPL', >- 'CPL' >+ $branchcode, >+ $branchcode > ], > 'copynos' => [ > '', > '' > ], > 'holdingbranches' => [ >- 'CPL', >- 'CPL' >+ $branchcode, >+ $branchcode > ], > 'ccodes' => [ > '', >@@ -389,7 +404,7 @@ subtest 'add_items_from_import_record() - addorderiso2709.pl' => sub { > my $itemnumbers = Koha::MarcOrder::add_items_from_import_record( > { > record_result => $result->{record_result}, >- basket_id => 1, >+ basket_id => $basket->basketno, > vendor => $bookseller, > budget_id => $budgetid, > agent => 'client', >@@ -397,14 +412,17 @@ subtest 'add_items_from_import_record() - addorderiso2709.pl' => sub { > } > ); > >- my $orders = Koha::Acquisition::Orders->search()->unblessed; >+ my $orders = >+ Koha::Acquisition::Orders->search( { biblionumber => $result->{record_result}->{biblionumber} } )->unblessed; > > is( > @{$orders}[0]->{rrp} + 0, '10', > "Price has been read correctly" > ); >+ >+ my $active_currency = Koha::Acquisition::Currencies->get_active; > is( >- @{$orders}[0]->{listprice} + 0, '10', >+ sprintf( "%.6f", @{$orders}[0]->{listprice} + 0 ), sprintf( "%.6f", 10 / $active_currency->rate + 0 ), > "Listprice has been created successfully" > ); > is( >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35026
:
157050
|
157051
|
157052
|
157056
|
157057
|
157058
|
159305
|
159306
|
159969
|
159970
|
159971
|
159972
|
159973
|
160833
|
160834
|
160835
|
160836
|
160837
|
160838
|
162647
|
162648
|
162649
|
162650
|
162651
|
162652
|
162653
|
162654
|
163787
|
163788
|
163789
|
163790
|
163791
|
163792
|
163793
|
163794
|
163819
|
163820
|
163835
|
163836
|
163838
|
163839
|
163840
|
163841
|
163842
|
163843
|
163844
|
163845
|
164695
|
164937
|
165378
|
165681
|
168123
|
168124
|
168125
|
168126
|
168127
|
168128
|
168129
|
168130
|
168131
|
168132
|
168971
|
168972
|
168973
|
168974
|
168975
|
168976
|
168977
|
168978
|
168979
|
168980
|
168981
|
169475
|
169476
|
169477
|
169478
|
169479
|
169480
|
169481
|
169482
|
169483
|
169484
|
169485
| 170504