Bugzilla – Attachment 115161 Details for
Bug 25808
Renewal via the SIP 'checkout' message gives incorrect message
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25808: (QA follow-up) Add regression test
Bug-25808-QA-follow-up-Add-regression-test.patch (text/plain), 2.80 KB, created by
Martin Renvoize (ashimema)
on 2021-01-14 14:41:33 UTC
(
hide
)
Description:
Bug 25808: (QA follow-up) Add regression test
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-01-14 14:41:33 UTC
Size:
2.80 KB
patch
obsolete
>From 8866f5773a3c9a5b191dd60a2e033d3587a28524 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 14 Jan 2021 14:40:31 +0000 >Subject: [PATCH] Bug 25808: (QA follow-up) Add regression test > >This patch adds a basic regression test for the bug. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/SIP/ILS.t | 53 +++++++++++++++++++++++++++++++++++++++- > 1 file changed, 52 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/SIP/ILS.t b/t/db_dependent/SIP/ILS.t >index f08a259621..a2c29886e7 100755 >--- a/t/db_dependent/SIP/ILS.t >+++ b/t/db_dependent/SIP/ILS.t >@@ -20,14 +20,16 @@ > > use Modern::Perl; > >-use Test::More tests => 10; >+use Test::More tests => 11; > > use t::lib::TestBuilder; > use t::lib::Mocks; > > use C4::Reserves; >+use C4::Circulation; > use Koha::CirculationRules; > use Koha::Database; >+use Koha::DateUtils; > > BEGIN { > use_ok('C4::SIP::ILS'); >@@ -122,4 +124,53 @@ subtest cancel_hold => sub { > is( $item->biblio->holds->count(), 0, "Bib has 0 holds remaining"); > is( $item->holds->count(), 0, "Item has 0 holds remaining"); > }; >+ >+subtest checkout => sub { >+ plan tests => 1; >+ >+ my $library = $builder->build_object ({ class => 'Koha::Libraries' }); >+ my $patron = $builder->build_object( >+ { >+ class => 'Koha::Patrons', >+ value => { >+ branchcode => $library->branchcode, >+ } >+ } >+ ); >+ t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode, flags => 1 }); >+ >+ my $item = $builder->build_sample_item({ >+ library => $library->branchcode, >+ }); >+ >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => $patron->categorycode, >+ branchcode => $library->branchcode, >+ itemtype => $item->effective_itemtype, >+ rules => { >+ onshelfholds => 1, >+ reservesallowed => 3, >+ holds_per_record => 3, >+ issuelength => 5, >+ lengthunit => 'days', >+ renewalsallowed => 6, >+ } >+ } >+ ); >+ >+ AddIssue( $patron->unblessed, $item->barcode, undef, 0 ); >+ my $checkout = $item->checkout; >+ ok( defined($checkout), "Checkout added"); >+ is( $checkout->renewals, 0, "Correct renewals"); >+ >+ my $ils = C4::SIP::ILS->new({ id => $library->branchcode }); >+ my $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber ); >+ my $transaction = $ils->checkout($patron->cardnumber,$item->barcode,undef,undef); >+ >+ is( $transaction->{screen_msg},"Item already checked out to you: renewing item.","We get a success message when issue is renewed"); >+ >+ is( $checkout->renewals, 1, "Renewals has been reduced"); >+}; >+ > $schema->storage->txn_rollback; >-- >2.20.1
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 25808
:
106028
|
109188
|
114289
|
114898
| 115161 |
115436