From baa7713a6d1736db4059bd936e68a528bba4e77d Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 11 Jul 2022 16:08:05 +0100 Subject: [PATCH] Bug 28854: (QA follow-up) Remove duplicate key test We now allow duplication of issue_id accross the return claims table (to allow for the case where a bundle item has been loaned and thus multiple claims can result from the same checkout. --- t/db_dependent/Koha/Checkouts/ReturnClaim.t | 27 +-------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/t/db_dependent/Koha/Checkouts/ReturnClaim.t b/t/db_dependent/Koha/Checkouts/ReturnClaim.t index a105b1af5d..4d12bc3751 100755 --- a/t/db_dependent/Koha/Checkouts/ReturnClaim.t +++ b/t/db_dependent/Koha/Checkouts/ReturnClaim.t @@ -31,7 +31,7 @@ my $builder = t::lib::TestBuilder->new; subtest "store() tests" => sub { - plan tests => 13; + plan tests => 11; $schema->storage->txn_begin; @@ -109,31 +109,6 @@ subtest "store() tests" => sub { is( ref($claim), 'Koha::Checkouts::ReturnClaim', 'Object type is correct' ); is( Koha::Checkouts::ReturnClaims->search( { issue_id => $checkout->id } )->count, 1, 'Claim stored on the DB'); - { # hide useless warnings - local *STDERR; - open STDERR, '>', '/dev/null'; - throws_ok { - Koha::Checkouts::ReturnClaim->new( - { - issue_id => $checkout->id, - itemnumber => $checkout->itemnumber, - borrowernumber => $checkout->borrowernumber, - notes => 'Some notes', - created_by => $librarian->borrowernumber - } - )->store; - } - 'Koha::Exceptions::Object::DuplicateID', - 'An exception is thrown on duplicate issue_id'; - close STDERR; - - like( - $@->duplicate_id, - qr/(return_claims\.)?issue_id/, - 'Exception field is correct' - ); - } - { # hide useless warnings local *STDERR; open STDERR, '>', '/dev/null'; -- 2.20.1