Bugzilla – Attachment 113559 Details for
Bug 26948
Some Koha Emails are double encoded (HOLD, ODUE, ...)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26948: Regression tests
Bug-26948-Regression-tests.patch (text/plain), 2.39 KB, created by
Martin Renvoize (ashimema)
on 2020-11-12 13:49:16 UTC
(
hide
)
Description:
Bug 26948: Regression tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-11-12 13:49:16 UTC
Size:
2.39 KB
patch
obsolete
>From 4b076df4f00147cb58f0fc081e2d7e03d66c9669 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 12 Nov 2020 13:36:00 +0000 >Subject: [PATCH] Bug 26948: Regression tests > >We already mock the send_or_die method from Email::Stuffer; This patch >updates that mock to extract the internal representation of the email >encoded message and looks for a known double encoded representation of a >character in the sample body. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Letters.t | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/Letters.t b/t/db_dependent/Letters.t >index 766e21d7f4..88dfec8b1d 100755 >--- a/t/db_dependent/Letters.t >+++ b/t/db_dependent/Letters.t >@@ -18,12 +18,14 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 73; >+use Test::More tests => 77; > use Test::MockModule; > use Test::Warn; > > use MARC::Record; > >+use utf8; >+ > my ( $email_object, $sendmail_params ); > > my $email_sender_module = Test::MockModule->new('Email::Stuffer'); >@@ -31,6 +33,8 @@ $email_sender_module->mock( > 'send_or_die', > sub { > ( $email_object, $sendmail_params ) = @_; >+ my $str = $email_object->email->as_string; >+ unlike $str, qr/I =C3=A2=C2=99=C2=A5 Koha=/, "Content is not double encoded"; > warn "Fake send_or_die"; > } > ); >@@ -110,8 +114,8 @@ is( $message_id, undef, 'EnqueueLetter without the letter argument returns undef > > delete $my_message->{message_transport_type}; > $my_message->{letter} = { >- content => 'a message', >- title => 'message title', >+ content => 'I ⥠Koha', >+ title => 'å¤é is great', > metadata => 'metadata', > code => 'TEST_MESSAGE', > content_type => 'text/plain', >@@ -534,7 +538,7 @@ is($email_object->email->header('To'), 'robert.tables@mail.com', "mailto address > t::lib::Mocks::mock_preference( 'SendAllEmailsTo', '' ); > > subtest 'SendAlerts - claimissue' => sub { >- plan tests => 9; >+ plan tests => 11; > > use C4::Serials; > >@@ -749,7 +753,7 @@ subtest 'TranslateNotices' => sub { > > subtest 'SendQueuedMessages' => sub { > >- plan tests => 9; >+ plan tests => 12; > > t::lib::Mocks::mock_preference( 'SMSSendDriver', 'Email' ); > t::lib::Mocks::mock_preference('EmailSMSSendDriverFromAddress', ''); >-- >2.20.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 26948
:
113242
|
113243
|
113244
|
113245
|
113545
|
113553
|
113555
|
113558
|
113559
|
113560
|
113561