Bugzilla – Attachment 130093 Details for
Bug 29759
Refund credit when cancelling an article request
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29759: (follow-up) Fix TemplateToolkit.t
Bug-29759-follow-up-Fix-TemplateToolkitt.patch (text/plain), 2.31 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-02-02 12:35:57 UTC
(
hide
)
Description:
Bug 29759: (follow-up) Fix TemplateToolkit.t
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-02-02 12:35:57 UTC
Size:
2.31 KB
patch
obsolete
>From c4a57c0a797c545c784066e2495ebbb06e9c7ee0 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 2 Feb 2022 09:32:37 -0300 >Subject: [PATCH] Bug 29759: (follow-up) Fix TemplateToolkit.t > >This patch makes the tests set debit_id to undef instead of random data. >This way tests don't break when $article_request->cancel is invoked and >a refund is tried. > >To test: >1. Run: > $ kshell > k$ prove t/db_dependent/Letters/TemplateToolkit.t >=> FAIL: Boo, tests fail, random garbage is not a debit >2. Apply this patch >3. Repeat 1 >=> SUCCESS: Tests pass! >4. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Letters/TemplateToolkit.t | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Letters/TemplateToolkit.t b/t/db_dependent/Letters/TemplateToolkit.t >index 127a98bd11..b69ebe118e 100755 >--- a/t/db_dependent/Letters/TemplateToolkit.t >+++ b/t/db_dependent/Letters/TemplateToolkit.t >@@ -379,8 +379,13 @@ Chapters: <<article_requests.chapters>> > Notes: <<article_requests.patron_notes>> > |; > reset_template( { template => $template, code => $code, module => 'circulation' } ); >- my $article_request = $builder->build({ source => 'ArticleRequest' }); >- Koha::ArticleRequests->find( $article_request->{id} )->cancel; >+ my $article_request = $builder->build_object( >+ { >+ class => 'Koha::ArticleRequests', >+ value => { debit_id => undef } >+ } >+ ); >+ $article_request->cancel; > my $letter = Koha::Notice::Messages->search( {}, { order_by => { -desc => 'message_id' } } )->next; > > my $tt_template = q| >@@ -401,7 +406,7 @@ Chapters: [% article_request.chapters %] > Notes: [% article_request.patron_notes %] > |; > reset_template( { template => $tt_template, code => $code, module => 'circulation' } ); >- Koha::ArticleRequests->find( $article_request->{id} )->cancel; >+ $article_request->cancel; > my $tt_letter = Koha::Notice::Messages->search( {}, { order_by => { -desc => 'message_id' } } )->next; > is( $tt_letter->content, $letter->content, 'Compare AR_* notices' ); > isnt( $tt_letter->message_id, $letter->message_id, 'Comparing AR_* notices should compare 2 different messages' ); >-- >2.32.0
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 29759
:
128874
|
128875
|
129162
|
129163
|
129181
|
129182
|
129297
|
129298
|
129302
|
129303
|
129304
|
130093
|
130094
|
130095
|
130096