From c767f74264438cf28accf6b4faeb727be3cb2197 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 24 Oct 2022 11:17:48 +0000 Subject: [PATCH] Bug 23012: (QA follow-up) No need to create and delete rules for branch The tests create a new branch to make sure one exists without rules. We then add a rule and delete it. We can simply create the new branch and never assign a rule Signed-off-by: Nick Clemens --- t/db_dependent/Koha/CirculationRules.t | 51 +------------------------- 1 file changed, 1 insertion(+), 50 deletions(-) diff --git a/t/db_dependent/Koha/CirculationRules.t b/t/db_dependent/Koha/CirculationRules.t index c4009c6a96..18c8653523 100755 --- a/t/db_dependent/Koha/CirculationRules.t +++ b/t/db_dependent/Koha/CirculationRules.t @@ -789,56 +789,7 @@ subtest 'get_lostreturn_policy() tests' => sub { ); # Make sure we have an unused branchcode - my $branchcode4 = $builder->build( { source => 'Branch' } )->{branchcode}; - my $specific_lost_rule_dummy = $builder->build( - { - source => 'CirculationRule', - value => { - branchcode => $branchcode4, - categorycode => undef, - itemtype => undef, - rule_name => 'lostreturn', - rule_value => 'refund' - } - } - ); - my $specific_proc_rule_dummy = $builder->build( - { - source => 'CirculationRule', - value => { - branchcode => $branchcode4, - categorycode => undef, - itemtype => undef, - rule_name => 'processingreturn', - rule_value => 'refund' - } - } - ); - my $branch_without_rule = $specific_lost_rule_dummy->{ branchcode }; - Koha::CirculationRules - ->search( - { - branchcode => $branch_without_rule, - categorycode => undef, - itemtype => undef, - rule_name => 'lostreturn', - rule_value => 'refund' - } - ) - ->next - ->delete; - Koha::CirculationRules - ->search( - { - branchcode => $branch_without_rule, - categorycode => undef, - itemtype => undef, - rule_name => 'processingreturn', - rule_value => 'refund' - } - ) - ->next - ->delete; + my $branch_without_rule = $builder->build( { source => 'Branch' } )->{branchcode}; my $item = $builder->build_sample_item( { -- 2.30.2