Bugzilla – Attachment 90315 Details for
Bug 11573
Fine descriptions related to Rentals are untranslatable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11573: Update of unit tests
Bug-11573-Update-of-unit-tests.patch (text/plain), 5.46 KB, created by
Martin Renvoize (ashimema)
on 2019-06-04 10:38:01 UTC
(
hide
)
Description:
Bug 11573: Update of unit tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-06-04 10:38:01 UTC
Size:
5.46 KB
patch
obsolete
>From 110ed1d6d79b9944bba3bbe6033a50343236f12d Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 24 Apr 2019 10:35:22 +0100 >Subject: [PATCH] Bug 11573: Update of unit tests > >This patch updates the unit tests to reflect the changes to the core >routines. The relevant changes are the removal of a hard coded >'description' and the splitting up of the 'Rent' accounttype into >'RENT', 'RENT_RENEW', 'RENT_DAILY' and 'RENT_DAILY_RENEW'. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/Circulation.t | 29 ++++++++++++---------------- > t/db_dependent/Circulation/Returns.t | 2 +- > t/db_dependent/Circulation/issue.t | 2 +- > 3 files changed, 14 insertions(+), 19 deletions(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 18dbb7b9b9..438b045a63 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -3005,7 +3005,7 @@ $cache->clear_from_cache('single_holidays'); > > subtest 'AddRenewal and AddIssuingCharge tests' => sub { > >- plan tests => 13; >+ plan tests => 10; > > $schema->storage->txn_begin; > >@@ -3065,34 +3065,29 @@ subtest 'AddRenewal and AddIssuingCharge tests' => sub { > # The following will fail if run on 00:00:00 > unlike ( $checkouts->next->lastreneweddate, qr/00:00:00/, 'AddRenewal should set the renewal date with the time part'); > >- t::lib::Mocks::mock_preference( 'RenewalLog', 1 ); >- $date = output_pref( { dt => dt_from_string(), dateonly => 1, dateformat => 'iso' } ); >- $old_log_size = Koha::ActionLogs->count( \%params_renewal ); >- AddRenewal( $patron->id, $item->id, $library->id ); >- $new_log_size = Koha::ActionLogs->count( \%params_renewal ); >- is( $new_log_size, $old_log_size + 1, 'renew log successfully added' ); >- > my $lines = Koha::Account::Lines->search({ > borrowernumber => $patron->id, > itemnumber => $item->id > }); > >- is( $lines->count, 3 ); >+ is( $lines->count, 2 ); > > my $line = $lines->next; >- is( $line->accounttype, 'Rent', 'The issuing charge generates an accountline' ); >+ is( $line->accounttype, 'RENT', 'The issue of item with issueing charge generates an accountline of the correct type' ); > is( $line->branchcode, $library->id, 'AddIssuingCharge correctly sets branchcode' ); >- is( $line->description, 'Rental', 'AddIssuingCharge set a hardcoded description for the accountline' ); >+ is( $line->description, '', 'AddIssue does not set a hardcoded description for the accountline' ); > > $line = $lines->next; >- is( $line->accounttype, 'Rent', 'Fine on renewed item is closed out properly' ); >+ is( $line->accounttype, 'RENT_RENEW', 'The renewal of item with issuing charge generates an accountline of the correct type' ); > is( $line->branchcode, $library->id, 'AddRenewal correctly sets branchcode' ); >- is( $line->description, "Renewal of Rental Item $title $barcode", 'AddRenewal set a hardcoded description for the accountline' ); >+ is( $line->description, '', 'AddRenewal does not set a hardcoded description for the accountline' ); > >- $line = $lines->next; >- is( $line->accounttype, 'Rent', 'Fine on renewed item is closed out properly' ); >- is( $line->branchcode, $library->id, 'AddRenewal correctly sets branchcode' ); >- is( $line->description, "Renewal of Rental Item $title $barcode", 'AddRenewal set a hardcoded description for the accountline' ); >+ t::lib::Mocks::mock_preference( 'RenewalLog', 1 ); >+ $date = output_pref( { dt => dt_from_string(), dateonly => 1, dateformat => 'iso' } ); >+ $old_log_size = Koha::ActionLogs->count( \%params_renewal ); >+ AddRenewal( $patron->id, $item->id, $library->id ); >+ $new_log_size = Koha::ActionLogs->count( \%params_renewal ); >+ is( $new_log_size, $old_log_size + 1, 'renew log successfully added' ); > > $schema->storage->txn_rollback; > }; >diff --git a/t/db_dependent/Circulation/Returns.t b/t/db_dependent/Circulation/Returns.t >index 66456687fe..f50638a789 100644 >--- a/t/db_dependent/Circulation/Returns.t >+++ b/t/db_dependent/Circulation/Returns.t >@@ -277,7 +277,7 @@ subtest 'Handle ids duplication' => sub { > my $issue_id = $original_checkout->issue_id; > my $account_lines = Koha::Account::Lines->search({ borrowernumber => $patron->borrowernumber, issue_id => $issue_id }); > is( $account_lines->count, 1, '1 account line should exist for this issue_id' ); >- is( $account_lines->next->description, 'Rental', 'patron has been charged the rentalcharge' ); >+ is( $account_lines->next->accounttype, 'RENT', 'patron has been charged the rentalcharge' ); > $account_lines->delete; > > # Create an existing entry in old_issue >diff --git a/t/db_dependent/Circulation/issue.t b/t/db_dependent/Circulation/issue.t >index e945876378..9abae4ac40 100644 >--- a/t/db_dependent/Circulation/issue.t >+++ b/t/db_dependent/Circulation/issue.t >@@ -211,7 +211,7 @@ $sth->execute; > my $countaccount = $sth->fetchrow_array; > is ($countaccount,0,"0 accountline exists"); > my $checkout = Koha::Checkouts->find( $issue_id1 ); >-my $charge = C4::Circulation::AddIssuingCharge( $checkout, 10 ); >+my $charge = C4::Circulation::AddIssuingCharge( $checkout, 10, 'rent' ); > is( ref( $charge ), 'Koha::Account::Line', "An issuing charge has been added" ); > is( $charge->issue_id, $issue_id1, 'Issue id is set correctly for issuing charge' ); > my $offset = Koha::Account::Offsets->find( { debit_id => $charge->id } ); >-- >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 11573
:
24473
|
24485
|
24486
|
25715
|
27822
|
27823
|
27824
|
47236
|
47237
|
47238
|
47239
|
47240
|
47241
|
47242
|
47288
|
47289
|
47290
|
47291
|
88549
|
88600
|
88601
|
88602
|
88603
|
88604
|
88605
|
88606
|
88726
|
88727
|
88728
|
88729
|
90231
|
90232
|
90233
|
90234
|
90246
|
90256
|
90313
|
90314
|
90315
|
90316
|
91529
|
91530
|
91531
|
91532
|
91800
|
91801
|
91802
|
91803
|
91804
|
91805
|
91806