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:
parent
4d994773f8
commit
df604d1102
|
|
@ -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(
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue