Bugzilla – Attachment 185241 Details for
Bug 40608
Password not changed if PASSWORD_CHANGE letter absent
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40608: (follow-up) Some tests rely on existing data
Bug-40608-follow-up-Some-tests-rely-on-existing-da.patch (text/plain), 2.14 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-08-07 19:25:49 UTC
(
hide
)
Description:
Bug 40608: (follow-up) Some tests rely on existing data
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-08-07 19:25:49 UTC
Size:
2.14 KB
patch
obsolete
>From 6d2a7e469fe611db37011d151527a53e370a3049 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 7 Aug 2025 16:18:39 -0300 >Subject: [PATCH] Bug 40608: (follow-up) Some tests rely on existing data > >Playing with the about page, I noticed prior tests in the codebase fail >if the letter doesn't exist. > >This patch fixes that. > >To test: >1. With a fresh KTD run: > $ ktd --shell > k$ prove t/db_dependent/Koha/Patron.t >=> SUCCESS: Tests pass! >2. Delete the existing notices: > k$ koha-mysql kohadev > > DELETE FROM letter WHERE code="PASSWORD_CHANGE"; \q >3. Repeat 1 >=> FAIL: Tests fail! Current tests print a warn (Test::NoWarning) >doesn't like this >4. Apply this patch >5. Repeat 1 >=> SUCCESS: Tests now pass. The test creates its own notice. >6. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Patron.t | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > >diff --git a/t/db_dependent/Koha/Patron.t b/t/db_dependent/Koha/Patron.t >index 6d049319359..d2d8182c819 100755 >--- a/t/db_dependent/Koha/Patron.t >+++ b/t/db_dependent/Koha/Patron.t >@@ -1555,6 +1555,24 @@ subtest 'password expiration tests' => sub { > } > } > ); >+ >+ # Create a PASSWORD_CHANGE letter template >+ $builder->build_object( >+ { >+ class => 'Koha::Notice::Templates', >+ value => { >+ module => 'members', >+ code => 'PASSWORD_CHANGE', >+ branchcode => '', >+ name => 'Password Change Notification', >+ is_html => 0, >+ title => 'Your password has been changed', >+ content => 'Dear [% borrower.firstname %], your password has been changed.', >+ message_transport_type => 'email', >+ lang => 'default' >+ } >+ } >+ ); > is( $patron->password_expired, 1, "Patron password is expired" ); > > $date = dt_from_string(); >-- >2.50.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 40608
:
185166
|
185167
|
185179
|
185238
|
185239
|
185240
|
185241
|
185257
|
185258
|
185259
|
185260
|
185261