Bugzilla – Attachment 158919 Details for
Bug 12133
Guarantor requirements when registering a patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12133: Fix failing tests
0001-Bug-12133-Fix-failing-tests.patch (text/plain), 3.02 KB, created by
Emmi Takkinen
on 2023-11-14 12:41:38 UTC
(
hide
)
Description:
Bug 12133: Fix failing tests
Filename:
MIME Type:
Creator:
Emmi Takkinen
Created:
2023-11-14 12:41:38 UTC
Size:
3.02 KB
patch
obsolete
>From a775a33f33d6b441c7b5f9a8ab0638cb697fe432 Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Date: Tue, 14 Nov 2023 13:44:11 +0200 >Subject: [PATCH] Bug 12133: Fix failing tests > >Tests in erm_users.t and Letters.t failed because when >we mock patrons they receive category where setting >can_be_guarantee is not 0. This triggers error "Child >patron cannot be a guarantor". We also need to mock >syspref "ChildNeedsGuarantor" accordingly. > >To test prove t/db_dependent/api/v1/erm_users.t and >t/db_dependent/Letters.t. > >Sponsored-by: Koha-Suomi Oy >--- > t/db_dependent/Letters.t | 12 ++++++++++-- > t/db_dependent/api/v1/erm_users.t | 7 ++++++- > 2 files changed, 16 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Letters.t b/t/db_dependent/Letters.t >index 05a026a821..9f888030b2 100755 >--- a/t/db_dependent/Letters.t >+++ b/t/db_dependent/Letters.t >@@ -1032,10 +1032,18 @@ subtest 'Test guarantor handling in SendQueuedMessages' => sub { > plan tests => 19; > > t::lib::Mocks::mock_preference( 'borrowerRelationship', 'test' ); >+ t::lib::Mocks::mock_preference( 'ChildNeedsGuarantor', 1 ); > > my $patron = Koha::Patrons->find($borrowernumber); >- my $guarantor1 = $builder->build_object( { class => 'Koha::Patrons', value => { email => 'g1@email.com' } } ); >- my $guarantor2 = $builder->build_object( { class => 'Koha::Patrons', value => { email => 'g2@email.com' } } ); >+ >+ my $patron_category = >+ $builder->build( { source => 'Category', value => { category_type => 'A', can_be_guarantee => 0 } } ) >+ ->{categorycode}; >+ my $guarantor1 = $builder->build_object( >+ { class => 'Koha::Patrons', value => { email => 'g1@email.com', categorycode => $patron_category } } ); >+ my $guarantor2 = $builder->build_object( >+ { class => 'Koha::Patrons', value => { email => 'g2@email.com', categorycode => $patron_category } } ); >+ > $patron->add_guarantor( { guarantor_id => $guarantor1->borrowernumber, relationship => 'test' } ); > $patron->add_guarantor( { guarantor_id => $guarantor2->borrowernumber, relationship => 'test' } ); > >diff --git a/t/db_dependent/api/v1/erm_users.t b/t/db_dependent/api/v1/erm_users.t >index 379db6562f..f038105384 100755 >--- a/t/db_dependent/api/v1/erm_users.t >+++ b/t/db_dependent/api/v1/erm_users.t >@@ -31,6 +31,7 @@ my $builder = t::lib::TestBuilder->new; > > my $t = Test::Mojo->new('Koha::REST::V1'); > t::lib::Mocks::mock_preference( 'RESTBasicAuth', 1 ); >+t::lib::Mocks::mock_preference( 'ChildNeedsGuarantor', 0 ); > > subtest 'list() tests' => sub { > >@@ -38,7 +39,11 @@ subtest 'list() tests' => sub { > > $schema->storage->txn_begin; > >- Koha::Patrons->search->update( { flags => 0 } ); >+ my $patron_category = >+ $builder->build( { source => 'Category', value => { category_type => 'A', can_be_guarantee => 0 } } ) >+ ->{categorycode}; >+ >+ Koha::Patrons->search->update( { flags => 0, categorycode => $patron_category } ); > $schema->resultset('UserPermission')->delete; > > my $librarian = $builder->build_object( >-- >2.34.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 12133
:
27517
|
27584
|
33459
|
91482
|
94371
|
94538
|
94544
|
99629
|
113099
|
113100
|
134013
|
134014
|
134015
|
146827
|
147440
|
148058
|
148070
|
152706
|
153082
|
153154
|
154300
|
154316
|
156387
|
156446
|
156447
|
158344
|
158345
|
158346
| 158919 |
158979