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 <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Nick Clemens 2022-10-24 11:17:48 +00:00 committed by Tomas Cohen Arazi
parent 4d994773f8
commit df604d1102
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 1 additions and 50 deletions

View File

@ -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(
{