Bugzilla – Attachment 139302 Details for
Bug 31382
Cannot reach password reset page when password expired
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31382: Regression tests
Bug-31382-Regression-tests.patch (text/plain), 2.59 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-08-17 18:42:42 UTC
(
hide
)
Description:
Bug 31382: Regression tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-08-17 18:42:42 UTC
Size:
2.59 KB
patch
obsolete
>From a947531f09fe7f428fa510817f77f21b231d538c Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 17 Aug 2022 15:40:07 -0300 >Subject: [PATCH] Bug 31382: Regression tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Auth.t | 43 ++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 42 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Auth.t b/t/db_dependent/Auth.t >index ad7f9ddc034..50d0f4c79b6 100755 >--- a/t/db_dependent/Auth.t >+++ b/t/db_dependent/Auth.t >@@ -41,7 +41,7 @@ $schema->storage->txn_begin; > > subtest 'checkauth() tests' => sub { > >- plan tests => 5; >+ plan tests => 6; > > my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { flags => undef } }); > >@@ -111,6 +111,47 @@ subtest 'checkauth() tests' => sub { > is( $userid, undef, 'If librarian user is used and password with GET, they should not be logged in' ); > }; > >+ subtest 'Template params tests (password_expired)' => sub { >+ >+ plan tests => 1; >+ >+ my $password_expired; >+ >+ my $patron_class = Test::MockModule->new('Koha::Patron'); >+ $patron_class->mock( 'password_expired', sub { return $password_expired; } ); >+ >+ my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { flags => 1 } }); >+ my $password = 'password'; >+ t::lib::Mocks::mock_preference( 'RequireStrongPassword', 0 ); >+ $patron->set_password( { password => $password } ); >+ >+ my $cgi_mock = Test::MockModule->new('CGI')->mock( 'request_method', 'POST' ); >+ my $cgi = CGI->new; >+ $cgi->param( -name => 'userid', -value => $patron->userid ); >+ $cgi->param( -name => 'password', -value => $password ); >+ >+ my $auth = Test::MockModule->new( 'C4::Auth' ); >+ # Tests will fail if we hit safe_exit >+ $auth->mock( 'safe_exit', sub { return } ); >+ >+ my ( $userid, $cookie, $sessionID, $flags ); >+ >+ { >+ t::lib::Mocks::mock_preference( 'DumpTemplateVarsOpac', 1 ); >+ # checkauth will redirect and safe_exit if not authenticated and not authorized >+ local *STDOUT; >+ my $stdout; >+ open STDOUT, '>', \$stdout; >+ >+ # Password has expired >+ $password_expired = 1; >+ C4::Auth::checkauth( $cgi, 0, { catalogue => 1 } ); >+ like( $stdout, qr{'password_has_expired' => 1}, 'password_has_expired is set to 1' ); >+ >+ close STDOUT; >+ }; >+ }; >+ > subtest 'Two-factor authentication' => sub { > > my $patron = $builder->build_object( >-- >2.37.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 31382
:
139249
|
139297
| 139302 |
139303