Bugzilla – Attachment 185260 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.24 KB, created by
Marcel de Rooy
on 2025-08-08 07:01:44 UTC
(
hide
)
Description:
Bug 40608: (follow-up) Some tests rely on existing data
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2025-08-08 07:01:44 UTC
Size:
2.24 KB
patch
obsolete
>From 4bfd14171a9f36c8037110d33520a1b40f94788e 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 >Content-Type: text/plain; charset=utf-8 > >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> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > 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 6d04931935..d2d8182c81 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.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 40608
:
185166
|
185167
|
185179
|
185238
|
185239
|
185240
|
185241
|
185257
|
185258
|
185259
| 185260 |
185261