Bug 32269: Prevent Circulation.t to fail randomly

Highlighted by Bug 32030: fix test builder for boolean

    #   Failed test 'Checkouts with auto-renewal can be renewed earliest on due date if no renewalbefore'
    #   at t/db_dependent/Circulation.t line 343.
    #          got: '2022-11-18T14:16:12'
    #     expected: '2022-12-02T00:00:00'

    #   Failed test 'Checkouts with auto-renewal can be renewed earliest on due date if no renewalbefore'
    #   at t/db_dependent/Circulation.t line 349.
    #          got: '2022-11-18T14:16:12'
    #     expected: '2022-12-02T23:59:00'
    # Looks like you failed 2 tests of 5

We were reaching return $now

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2022-11-18 15:31:10 +01:00 committed by Tomas Cohen Arazi
parent 6e9903423e
commit 1672bd3ed2
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -5638,7 +5638,14 @@ subtest "GetSoonestRenewDate tests" => sub {
rule_value => '7',
}
);
my $patron = $builder->build_object({ class => 'Koha::Patrons' });
my $patron = $builder->build_object(
{
class => 'Koha::Patrons',
value => {
autorenew_checkouts => 1,
}
}
);
my $item = $builder->build_sample_item();
my $issue = AddIssue( $patron->unblessed, $item->barcode);
my $datedue = dt_from_string( $issue->date_due() );