Bugzilla – Attachment 182736 Details for
Bug 39970
REST API - Creating a patron without mandatory attribute types does not error (it should)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39970: Add tests
Bug-39970-Add-tests.patch (text/plain), 1.95 KB, created by
David Nind
on 2025-05-22 15:06:21 UTC
(
hide
)
Description:
Bug 39970: Add tests
Filename:
MIME Type:
Creator:
David Nind
Created:
2025-05-22 15:06:21 UTC
Size:
1.95 KB
patch
obsolete
>From 3189a1a533c2afea8ec01e74b51aea10d893aa38 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Thu, 22 May 2025 13:45:28 +0000 >Subject: [PATCH] Bug 39970: Add tests > >Test plan: >1) Apply this test patch. Run. Verify it fails >2) Apply other patch. Run. Verify it passes. > >prove t/db_dependent/api/v1/patrons.t > >Verify no other regressions are introduced, run: >prove t/db_dependent/Koha/Patron/Attribute.t > >Signed-off-by: David Nind <david@davidnind.com> >--- > t/db_dependent/api/v1/patrons.t | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/patrons.t b/t/db_dependent/api/v1/patrons.t >index 6ca12dd053..4441725386 100755 >--- a/t/db_dependent/api/v1/patrons.t >+++ b/t/db_dependent/api/v1/patrons.t >@@ -926,7 +926,7 @@ subtest 'update() tests' => sub { > > subtest "extended_attributes tests" => sub { > >- plan tests => 26; >+ plan tests => 29; > > my $attr_type_repeatable = $builder->build_object( > { >@@ -968,6 +968,19 @@ subtest 'update() tests' => sub { > { type => $deleted_attr_code, value => 'potato' }, > ]; > >+ $t->post_ok( >+ "//$userid:$password@/api/v1/patrons" => json => { >+ "firstname" => "Katrina", >+ "surname" => "Fischer", >+ "address" => "Somewhere", >+ "category_id" => "ST", >+ "city" => "Konstanz", >+ "library_id" => "MPL" >+ } >+ )->status_is(400) >+ ->json_is( >+ '/error' => "Missing mandatory extended attribute (type=" . $attr_type_mandatory->code . ")" ); >+ > $t->put_ok( "//$userid:$password@/api/v1/patrons/" > . $superlibrarian->borrowernumber => { 'x-koha-embed' => 'extended_attributes' } => json => > $newpatron )->status_is(400) >-- >2.39.5
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 39970
:
182731
|
182732
|
182736
|
182737
|
182803
|
182819
|
182820