Bugzilla – Attachment 165801 Details for
Bug 32565
Holds placed when all libraries are closed do not get added to holds queue if HoldsQueueSkipClosed and RealTimeHoldsQueue are enabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32565: Unit tests
Bug-32565-Unit-tests.patch (text/plain), 3.53 KB, created by
Tomás Cohen Arazi
on 2024-04-29 18:45:57 UTC
(
hide
)
Description:
Bug 32565: Unit tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2024-04-29 18:45:57 UTC
Size:
3.53 KB
patch
obsolete
>From 81429cd23d653398a6200edb5594551659ba7f4e Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 25 Jan 2024 12:31:46 +0000 >Subject: [PATCH] Bug 32565: Unit tests > >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >--- > t/db_dependent/HoldsQueue.t | 80 ++++++++++++++++++++++++++++++++++++- > 1 file changed, 79 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/HoldsQueue.t b/t/db_dependent/HoldsQueue.t >index d0c9a74642a..531f9edb80a 100755 >--- a/t/db_dependent/HoldsQueue.t >+++ b/t/db_dependent/HoldsQueue.t >@@ -8,7 +8,7 @@ > > use Modern::Perl; > >-use Test::More tests => 63; >+use Test::More tests => 64; > use Data::Dumper; > > use C4::Calendar qw( new insert_single_holiday ); >@@ -2211,3 +2211,81 @@ subtest "Canceled holds should be removed from the holds queue" => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest "Test unallocated option" => sub { >+ >+ plan tests => 6; >+ >+ $schema->storage->txn_begin; >+ >+ my $patron = $builder->build_object( >+ { >+ class => "Koha::Patrons", >+ } >+ ); >+ my $patron_2 = $builder->build_object( >+ { >+ class => "Koha::Patrons", >+ } >+ ); >+ >+ my $item1 = $builder->build_sample_item( {} )->store(); >+ >+ my $item2 = $builder->build_sample_item( {} )->store(); >+ >+ my $reserve_id = AddReserve( >+ { >+ branchcode => $patron->branchcode, >+ borrowernumber => $patron->borrowernumber, >+ biblionumber => $item1->biblionumber, >+ priority => 1, >+ } >+ ); >+ >+ C4::HoldsQueue::CreateQueue(); >+ >+ my $queue_rs = $schema->resultset('TmpHoldsqueue')->search( { biblionumber => $item1->biblionumber } ); >+ my $hold = $queue_rs->next; >+ is( >+ $hold->itemnumber->itemnumber, >+ $item1->itemnumber, >+ "Picked the item" >+ ); >+ >+ my $timestamp = $hold->timestamp; >+ >+ sleep 2; >+ C4::HoldsQueue::CreateQueue(); >+ $queue_rs = $schema->resultset('TmpHoldsqueue')->search( { biblionumber => $item1->biblionumber } ); >+ $hold = $queue_rs->next; >+ isnt( $hold->timestamp, $timestamp, "Hold was reallocated when queue fully rebuilt" ); >+ $timestamp = $hold->timestamp; >+ >+ C4::HoldsQueue::CreateQueue( { unallocated => 1 } ); >+ $queue_rs = $schema->resultset('TmpHoldsqueue')->search( { biblionumber => $item1->biblionumber } ); >+ $hold = $queue_rs->next; >+ is( $hold->timestamp, $timestamp, "Previously allocated hold not updated when unallocated passed" ); >+ >+ my $reserve_id_2 = AddReserve( >+ { >+ branchcode => $patron_2->branchcode, >+ borrowernumber => $patron_2->borrowernumber, >+ biblionumber => $item2->biblionumber, >+ priority => 1, >+ } >+ ); >+ $queue_rs = $schema->resultset('TmpHoldsqueue')->search( { biblionumber => $item2->biblionumber } ); >+ $hold = $queue_rs->next; >+ ok( !$hold, "New hold is not allocated to queue before run" ); >+ C4::HoldsQueue::CreateQueue( { unallocated => 1 } ); >+ $queue_rs = $schema->resultset('TmpHoldsqueue')->search( { biblionumber => $item2->biblionumber } ); >+ $hold = $queue_rs->next; >+ ok( $hold, "New hold is allocated to queue when run for unallocated holds" ); >+ >+ $queue_rs = $schema->resultset('TmpHoldsqueue')->search( { biblionumber => $item1->biblionumber } ); >+ $hold = $queue_rs->next; >+ is( >+ $hold->timestamp, $timestamp, >+ "Previously allocated hold not updated when unallocated passed and others are allocated" >+ ); >+}; >-- >2.44.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32565
:
147659
|
161231
|
161232
|
161393
|
161394
|
161679
|
161680
|
162269
|
162297
|
164272
|
164273
|
164274
|
165166
|
165167
|
165168
|
165169
|
165800
| 165801 |
165802
|
165803