Bugzilla – Attachment 131358 Details for
Bug 22993
Messaging preferences not set for patrons imported through API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22993: Unit tests
Bug-22993-Unit-tests.patch (text/plain), 2.61 KB, created by
Kyle M Hall (khall)
on 2022-03-03 19:34:58 UTC
(
hide
)
Description:
Bug 22993: Unit tests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2022-03-03 19:34:58 UTC
Size:
2.61 KB
patch
obsolete
>From 7f3d6fbd590b53fb1502be0f948b1e731069d509 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 25 Feb 2022 20:04:14 +0000 >Subject: [PATCH] Bug 22993: Unit tests > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/api/v1/patrons.t | 40 ++++++++++++++++++++++++++++++++- > 1 file changed, 39 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/patrons.t b/t/db_dependent/api/v1/patrons.t >index 9f052cf091..3d23b60372 100755 >--- a/t/db_dependent/api/v1/patrons.t >+++ b/t/db_dependent/api/v1/patrons.t >@@ -27,6 +27,7 @@ use t::lib::Mocks; > use t::lib::Dates; > > use C4::Auth; >+use C4::Members::Messaging; > use Koha::Database; > use Koha::DateUtils qw(dt_from_string output_pref); > use Koha::Exceptions::Patron; >@@ -301,7 +302,7 @@ subtest 'add() tests' => sub { > $schema->storage->txn_rollback; > > subtest 'librarian access tests' => sub { >- plan tests => 24; >+ plan tests => 25; > > $schema->storage->txn_begin; > >@@ -539,6 +540,43 @@ subtest 'add() tests' => sub { > is( $extended_attributes, 'a b c d e', 'Extended attributes are stored correctly'); > }; > >+ subtest 'default patron messaging preferences handling' => sub { >+ >+ plan tests => 3; >+ >+ t::lib::Mocks::mock_preference( 'EnhancedMessagingPreferences', 1 ); >+ >+ C4::Members::Messaging::SetMessagingPreference({ >+ categorycode => 'ST', >+ message_attribute_id => 1, >+ message_transport_types => ['email'], >+ wants_digest => 1 >+ }); >+ >+ my $patron_id = $t->post_ok( >+ "//$userid:$password@/api/v1/patrons" => json => { >+ "firstname" => "Nick", >+ "surname" => "Clemens", >+ "address" => "Somewhere", >+ "category_id" => "ST", >+ "city" => "Smallville", >+ "library_id" => "MPL", >+ } >+ )->status_is(201, 'Patron added')->tx->res->json->{patron_id}; >+ >+ my $messaging_preferences = C4::Members::Messaging::GetMessagingPreferences({ borrowernumber => $patron_id, message_name => 'Item_Due' }); >+ >+ is_deeply( >+ $messaging_preferences, >+ { >+ letter_code => 'DUEDGST', >+ wants_digest => 1, >+ transports => { email => 'DUEDGST' } >+ } , >+ 'Default messaging preferences set correctly' >+ ); >+ }; >+ > $schema->storage->txn_rollback; > }; > }; >-- >2.30.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 22993
:
131131
|
131132
|
131358
|
131359
|
131361
|
131362
|
132300