Bug 29234: (QA follow-up) Fix test that expects wrong defaults

This patch changes the get_items_that_can_fill tests so they explicitly
set a 'datearrived' as the new defaults for fresh transfer objects from
TestBuilder is more sane and has this field undef. Tests *should always*
create their required scenarios explicitly.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6ab19f01b8)
Signed-off-by: Jacob O'Mara <jacobomara901@gmail.com>
This commit is contained in:
Tomas Cohen Arazi 2023-03-31 18:30:14 +02:00 committed by Jacob O'Mara
parent f1010ee062
commit aeb6cae060
2 changed files with 10 additions and 5 deletions

View File

@ -1738,10 +1738,15 @@ subtest 'Koha::Holds->get_items_that_can_fill returns items with datecancelled o
my $biblio2 = $builder->build_sample_biblio();
my $item2 = $builder->build_sample_item({ biblionumber => $biblio2->biblionumber });
my $transfer2 = $builder->build_object({ class => "Koha::Item::Transfers", value => {
datecancelled => undef,
itemnumber => $item2->itemnumber
}});
my $transfer2 = $builder->build_object(
{ class => "Koha::Item::Transfers",
value => {
datearrived => dt_from_string,
datecancelled => undef,
itemnumber => $item2->itemnumber
}
}
);
my $hold2 = $builder->build_object({ class => 'Koha::Holds', value => {
biblionumber => $biblio2->biblionumber,

View File

@ -592,7 +592,7 @@ sub _gen_default_values {
},
Branchtransfer => {
daterequested => dt_from_string(),
datesent => dt_from_string(),
datesent => undef,
datearrived => undef,
datecancelled => undef,
reason => undef,