Bugzilla – Attachment 168738 Details for
Bug 28924
Allow checkout fine limit to be determined by patron category
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28924: (QA follow-up): Fix unit tests
Bug-28924-QA-follow-up-Fix-unit-tests.patch (text/plain), 7.89 KB, created by
Nick Clemens (kidclamp)
on 2024-07-10 13:32:31 UTC
(
hide
)
Description:
Bug 28924: (QA follow-up): Fix unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-07-10 13:32:31 UTC
Size:
7.89 KB
patch
obsolete
>From e13942f6defc576385dc7b282c47daa67060ba82 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Fri, 14 Jun 2024 14:47:57 +0000 >Subject: [PATCH] Bug 28924: (QA follow-up): Fix unit tests > >Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > .../Circulation/NoIssuesChargeGuarantees.t | 7 +++++-- > t/db_dependent/Koha/Patron.t | 19 +++++++++---------- > t/db_dependent/SIP/Transaction.t | 8 ++++---- > 3 files changed, 18 insertions(+), 16 deletions(-) > >diff --git a/t/db_dependent/Circulation/NoIssuesChargeGuarantees.t b/t/db_dependent/Circulation/NoIssuesChargeGuarantees.t >index af88af096f3..f3d51fc91fd 100755 >--- a/t/db_dependent/Circulation/NoIssuesChargeGuarantees.t >+++ b/t/db_dependent/Circulation/NoIssuesChargeGuarantees.t >@@ -40,7 +40,7 @@ my $patron_category = $builder->build( > source => 'Category', > value => { > categorycode => 'NOT_X', category_type => 'P', enrolmentfee => 0, noissueschargeguarantees => 0, >- noissuescharge => 0, noissueschargeguarantorswithguarantees => 0 >+ noissuescharge => 0, noissueschargeguarantorswithguarantees => 0 > } > } > ); >@@ -86,7 +86,10 @@ is( $issuingimpossible->{DEBT_GUARANTEES} + 0, '10.00' + 0, "Patron cannot check > > $patron->category->noissueschargeguarantees(11); > ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $patron, $item->barcode ); >-is( $issuingimpossible->{DEBT_GUARANTEES}, undef, "Patron can check out item as the patron category limit is now higher than 10" ); >+is( >+ $issuingimpossible->{DEBT_GUARANTEES}, undef, >+ "Patron can check out item as the patron category limit is now higher than 10" >+); > > my $accountline = Koha::Account::Lines->search({ borrowernumber => $guarantee->id })->next(); > is( $accountline->amountoutstanding+0, 10, "Found 10.00 amount outstanding" ); >diff --git a/t/db_dependent/Koha/Patron.t b/t/db_dependent/Koha/Patron.t >index bfc19389969..96f43fa4f8e 100755 >--- a/t/db_dependent/Koha/Patron.t >+++ b/t/db_dependent/Koha/Patron.t >@@ -2412,14 +2412,14 @@ subtest 'is_patron_inside_charge_limits() tests' => sub { > )->store; > > my $patron_borrowing_status; >- $patron_borrowing_status = $patron->is_patron_inside_charge_limits( { patron => $patron } ); >+ $patron_borrowing_status = $patron->is_patron_inside_charge_limits(); > > is( $patron_borrowing_status->{noissuescharge}->{charge}, 11, "Only patron's fines are reported in total" ); > is( $patron_borrowing_status->{noissuescharge}->{limit}, 10, "Limit correctly identified at category level" ); > is( $patron_borrowing_status->{noissuescharge}->{overlimit}, 1, "Patron is over the charge limit" ); > > $patron->category->noissuescharge(undef); >- $patron_borrowing_status = $patron->is_patron_inside_charge_limits( { patron => $patron } ); >+ $patron_borrowing_status = $patron->is_patron_inside_charge_limits(); > is( $patron_borrowing_status->{noissuescharge}->{limit}, 50, "Limit correctly identified at global syspref level" ); > is( $patron_borrowing_status->{noissuescharge}->{charge}, 11, "Charges correctly identified" ); > is( $patron_borrowing_status->{noissuescharge}->{overlimit}, 0, "Patron is within the charge limit" ); >@@ -2432,7 +2432,7 @@ subtest 'is_patron_inside_charge_limits() tests' => sub { > is( $patron_borrowing_status->{NoIssuesChargeGuarantees}->{overlimit}, 1, "Patron is over the charge limit" ); > > $patron->category->noissueschargeguarantees(12); >- $patron_borrowing_status = $patron->is_patron_inside_charge_limits( { patron => $patron } ); >+ $patron_borrowing_status = $patron->is_patron_inside_charge_limits(); > is( > $patron_borrowing_status->{NoIssuesChargeGuarantees}->{limit}, 12, > "Limit correctly identified at patron category level" >@@ -2441,12 +2441,12 @@ subtest 'is_patron_inside_charge_limits() tests' => sub { > is( $patron_borrowing_status->{NoIssuesChargeGuarantees}->{overlimit}, 0, "Patron is inside the charge limit" ); > > is( >- $patron_borrowing_status->{NoIssuesChargeGuarantorsWithGuarantees}->{limit}, 0, >+ $patron_borrowing_status->{NoIssuesChargeGuarantorsWithGuarantees}->{limit}, undef, > "Limit correctly identified as not set at either patron category or global syspref level" > ); > is( >- $patron_borrowing_status->{NoIssuesChargeGuarantorsWithGuarantees}->{charge}, 22.22, >- "Charges correctly identified" >+ $patron_borrowing_status->{NoIssuesChargeGuarantorsWithGuarantees}->{charge}, 0, >+ "Charges ignored as there is no limit set at either patron category or global syspref level" > ); > is( > $patron_borrowing_status->{NoIssuesChargeGuarantorsWithGuarantees}->{overlimit}, 0, >@@ -2455,7 +2455,7 @@ subtest 'is_patron_inside_charge_limits() tests' => sub { > > $patron->category->noissueschargeguarantorswithguarantees(23); > t::lib::Mocks::mock_preference( 'NoIssuesChargeGuarantorsWithGuarantees', 20 ); >- $patron_borrowing_status = $patron->is_patron_inside_charge_limits( { patron => $patron } ); >+ $patron_borrowing_status = $patron->is_patron_inside_charge_limits(); > is( > $patron_borrowing_status->{NoIssuesChargeGuarantorsWithGuarantees}->{limit}, 23, > "Limit correctly identified at patron category level" >@@ -2470,8 +2470,7 @@ subtest 'is_patron_inside_charge_limits() tests' => sub { > ); > > $patron->category->noissueschargeguarantorswithguarantees(undef); >- t::lib::Mocks::mock_preference( 'NoIssuesChargeGuarantorsWithGuarantees', 20 ); >- $patron_borrowing_status = $patron->is_patron_inside_charge_limits( { patron => $patron } ); >+ $patron_borrowing_status = $patron->is_patron_inside_charge_limits(); > is( > $patron_borrowing_status->{NoIssuesChargeGuarantorsWithGuarantees}->{limit}, 20, > "Limit correctly defaults to global syspref" >@@ -2482,7 +2481,7 @@ subtest 'is_patron_inside_charge_limits() tests' => sub { > ); > is( > $patron_borrowing_status->{NoIssuesChargeGuarantorsWithGuarantees}->{overlimit}, 1, >- "Patron is inside the charge limit" >+ "Patron is over the charge limit" > ); > > $schema->storage->txn_rollback; >diff --git a/t/db_dependent/SIP/Transaction.t b/t/db_dependent/SIP/Transaction.t >index 4b2c2315989..f24f8bb90e7 100755 >--- a/t/db_dependent/SIP/Transaction.t >+++ b/t/db_dependent/SIP/Transaction.t >@@ -659,7 +659,7 @@ subtest do_checkout_with_sysprefs_override => sub { > { > class => 'Koha::Patrons', > value => { >- branchcode => $library->branchcode, >+ branchcode => $library->branchcode, > categorycode => $patron_category->{categorycode}, > } > } >@@ -681,7 +681,7 @@ subtest do_checkout_with_sysprefs_override => sub { > { > class => 'Koha::Patrons', > value => { >- branchcode => $library->branchcode, >+ branchcode => $library->branchcode, > categorycode => $patron_category->{categorycode}, > } > } >@@ -797,7 +797,7 @@ subtest do_checkout_with_patron_blocked => sub { > source => 'Category', > value => { > categorycode => 'NOT_X2', category_type => 'P', enrolmentfee => 0, noissueschargeguarantees => 0, >- noissuescharge => 0, noissueschargeguarantorswithguarantees => 0 >+ noissuescharge => 0, noissueschargeguarantorswithguarantees => 0 > } > } > ); >@@ -818,7 +818,7 @@ subtest do_checkout_with_patron_blocked => sub { > { > class => 'Koha::Patrons', > value => { >- branchcode => $library->branchcode, >+ branchcode => $library->branchcode, > categorycode => $patron_category->{categorycode}, > } > } >-- >2.39.2
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 28924
:
165870
|
165871
|
165872
|
165873
|
165874
|
165875
|
165876
|
166042
|
166043
|
166044
|
166045
|
166046
|
166047
|
166048
|
166171
|
166172
|
166173
|
166174
|
166175
|
166176
|
166177
|
167719
|
167720
|
167721
|
167722
|
167723
|
167724
|
167725
|
167726
|
167727
|
167728
|
167729
|
167730
|
167731
|
167732
|
167733
|
167734
|
167735
|
167736
|
167737
|
167738
|
167739
|
167740
|
168728
|
168729
|
168730
|
168731
|
168732
|
168733
|
168734
|
168735
|
168736
|
168737
|
168738
|
168984
|
168985
|
168986
|
168987
|
168988
|
168989
|
168990
|
168991
|
168992
|
168993
|
168994
|
168995
|
169177
|
169428