Bugzilla – Attachment 133810 Details for
Bug 29924
Introduce password expiration to patron categories
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29924: Add tests for API Basic auth behavior
Bug-29924-Add-tests-for-API-Basic-auth-behavior.patch (text/plain), 1.56 KB, created by
Tomás Cohen Arazi
on 2022-04-25 14:33:24 UTC
(
hide
)
Description:
Bug 29924: Add tests for API Basic auth behavior
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2022-04-25 14:33:24 UTC
Size:
1.56 KB
patch
obsolete
>From a2e5225823b3eb4ba94f738cc0c3da0f932acd31 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 25 Apr 2022 11:05:15 -0300 >Subject: [PATCH] Bug 29924: Add tests for API Basic auth behavior > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/api/v1/auth_basic.t | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/auth_basic.t b/t/db_dependent/api/v1/auth_basic.t >index 49fdfe93d2e..78c75720410 100755 >--- a/t/db_dependent/api/v1/auth_basic.t >+++ b/t/db_dependent/api/v1/auth_basic.t >@@ -23,6 +23,8 @@ use Test::Mojo; > use t::lib::TestBuilder; > use t::lib::Mocks; > >+use Koha::DateUtils qw( dt_from_string ); >+ > my $schema = Koha::Database->new->schema; > my $builder = t::lib::TestBuilder->new; > >@@ -77,7 +79,7 @@ subtest 'success tests' => sub { > > subtest 'failure tests' => sub { > >- plan tests => 8; >+ plan tests => 13; > > $schema->storage->txn_begin; > >@@ -91,6 +93,16 @@ subtest 'failure tests' => sub { > $patron->set_password({ password => $password }); > my $userid = $patron->userid; > >+ $t->get_ok("//$userid:$password@/api/v1/patrons") >+ ->status_is( 200, 'All good' ); >+ >+ # expire patron's password >+ $patron->password_expiration_date( dt_from_string->subtract( days => 1 ) )->store; >+ >+ $t->get_ok("//$userid:$password@/api/v1/patrons") >+ ->status_is( 403 ) >+ ->json_is( '/error' => 'Password has expired', 'Password expired' ); >+ > $t->get_ok("//@/api/v1/patrons") > ->status_is( 401, 'No credentials passed' ); > >-- >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 29924
:
129705
|
129706
|
129707
|
129708
|
129762
|
129763
|
129764
|
129765
|
129766
|
129823
|
129953
|
129954
|
129955
|
129956
|
129957
|
130116
|
130117
|
130118
|
130119
|
130120
|
130495
|
130500
|
130501
|
130502
|
130503
|
130504
|
130505
|
130557
|
130558
|
130559
|
130560
|
130561
|
130562
|
130563
|
130677
|
130678
|
130679
|
130680
|
130681
|
130682
|
130683
|
131128
|
132059
|
132060
|
132061
|
132062
|
132063
|
132064
|
132065
|
132066
|
132084
|
132085
|
132086
|
132087
|
132088
|
132089
|
132090
|
132091
|
132092
|
133741
|
133742
|
133743
|
133744
|
133745
|
133746
|
133747
|
133748
|
133801
|
133802
|
133803
|
133804
|
133805
|
133806
|
133807
|
133808
|
133809
| 133810 |
133989
|
134758