Bugzilla – Attachment 98339 Details for
Bug 18936
Move issuingrules into circulation_rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18936: (follow-up) Adjust circ rule related tests so that they pass
Bug-18936-follow-up-Adjust-circ-rule-related-tests.patch (text/plain), 8.90 KB, created by
Jonathan Druart
on 2020-02-03 16:09:19 UTC
(
hide
)
Description:
Bug 18936: (follow-up) Adjust circ rule related tests so that they pass
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-02-03 16:09:19 UTC
Size:
8.90 KB
patch
obsolete
>From 7958198894d79e5caa403be83c9034d044564a6f Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <joonas.kylmala@helsinki.fi> >Date: Wed, 29 Jan 2020 11:09:17 +0000 >Subject: [PATCH] Bug 18936: (follow-up) Adjust circ rule related tests so that > they pass >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Bunch of tests broke after moving from issuingrules to >circulation_rules. This accomodates the tests for this refactoring and >DB change. > >Signed-off-by: Minna Kivinen <minna.kivinen@hamk.fi> > >Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> >--- > t/db_dependent/HoldsQueue.t | 1 - > t/db_dependent/Koha/Biblio.t | 25 ++++++++++--------------- > t/db_dependent/Koha/Item.t | 18 ++++++++++-------- > t/db_dependent/selenium/basic_workflow.t | 11 ++++++----- > 4 files changed, 26 insertions(+), 29 deletions(-) > >diff --git a/t/db_dependent/HoldsQueue.t b/t/db_dependent/HoldsQueue.t >index 2c52c87ca4..f70e61f617 100755 >--- a/t/db_dependent/HoldsQueue.t >+++ b/t/db_dependent/HoldsQueue.t >@@ -950,7 +950,6 @@ subtest "Test Local Holds Priority - Ensure no duplicate requests in holds queue > $dbh->do("DELETE FROM tmp_holdsqueue"); > $dbh->do("DELETE FROM hold_fill_targets"); > $dbh->do("DELETE FROM reserves"); >- $dbh->do("DELETE FROM issuingrules"); > $dbh->do("DELETE FROM circulation_rules"); > Koha::Biblios->delete(); > >diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t >index 2abacff51a..790b623aad 100644 >--- a/t/db_dependent/Koha/Biblio.t >+++ b/t/db_dependent/Koha/Biblio.t >@@ -187,15 +187,18 @@ subtest 'pickup_locations' => sub { > Koha::Patrons->search->delete; > Koha::Items->search->delete; > Koha::Libraries->search->delete; >+ Koha::CirculationRules->search->delete; > $dbh->do('DELETE FROM issues'); >- $dbh->do('DELETE FROM issuingrules'); >- $dbh->do( >- q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed) >- VALUES (?, ?, ?, ?)}, >- {}, >- '*', '*', '*', 25 >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => undef, >+ itemtype => undef, >+ branchcode => undef, >+ rules => { >+ reservesallowed => 25, >+ } >+ } > ); >- $dbh->do('DELETE FROM circulation_rules'); > > my $root1 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_hold_group => 1 } } ); > my $root2 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_hold_group => 1 } } ); >@@ -214,7 +217,6 @@ subtest 'pickup_locations' => sub { > { > branchcode => $library1->branchcode, > itemtype => undef, >- categorycode => undef, > rules => { > holdallowed => 1, > hold_fulfillment_policy => 'any', >@@ -227,7 +229,6 @@ subtest 'pickup_locations' => sub { > { > branchcode => $library2->branchcode, > itemtype => undef, >- categorycode => undef, > rules => { > holdallowed => 3, > hold_fulfillment_policy => 'holdgroup', >@@ -240,7 +241,6 @@ subtest 'pickup_locations' => sub { > { > branchcode => $library3->branchcode, > itemtype => undef, >- categorycode => undef, > rules => { > holdallowed => 3, > hold_fulfillment_policy => 'patrongroup', >@@ -253,7 +253,6 @@ subtest 'pickup_locations' => sub { > { > branchcode => $library4->branchcode, > itemtype => undef, >- categorycode => undef, > rules => { > holdallowed => 2, > hold_fulfillment_policy => 'holdingbranch', >@@ -266,7 +265,6 @@ subtest 'pickup_locations' => sub { > { > branchcode => $library5->branchcode, > itemtype => undef, >- categorycode => undef, > rules => { > holdallowed => 2, > hold_fulfillment_policy => 'homebranch', >@@ -279,7 +277,6 @@ subtest 'pickup_locations' => sub { > { > branchcode => $library6->branchcode, > itemtype => undef, >- categorycode => undef, > rules => { > holdallowed => 1, > hold_fulfillment_policy => 'holdgroup', >@@ -292,7 +289,6 @@ subtest 'pickup_locations' => sub { > { > branchcode => $library7->branchcode, > itemtype => undef, >- categorycode => undef, > rules => { > holdallowed => 3, > hold_fulfillment_policy => 'holdingbranch', >@@ -306,7 +302,6 @@ subtest 'pickup_locations' => sub { > { > branchcode => $library8->branchcode, > itemtype => undef, >- categorycode => undef, > rules => { > holdallowed => 2, > hold_fulfillment_policy => 'patrongroup', >diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t >index 459c59fc3a..f4484caceb 100644 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -157,14 +157,17 @@ subtest 'pickup_locations' => sub { > Koha::Items->search->delete; > Koha::Libraries->search->delete; > $dbh->do('DELETE FROM issues'); >- $dbh->do('DELETE FROM issuingrules'); >- $dbh->do( >- q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed) >- VALUES (?, ?, ?, ?)}, >- {}, >- '*', '*', '*', 25 >+ Koha::CirculationRules->search->delete; >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => undef, >+ itemtype => undef, >+ branchcode => undef, >+ rules => { >+ reservesallowed => 25, >+ } >+ } > ); >- $dbh->do('DELETE FROM circulation_rules'); > > my $root1 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_hold_group => 1 } } ); > my $root2 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_hold_group => 1 } } ); >@@ -273,7 +276,6 @@ subtest 'pickup_locations' => sub { > { > branchcode => undef, > itemtype => undef, >- categorycode => undef, > rules => { > holdallowed => $ha, > hold_fulfillment_policy => $hfp, >diff --git a/t/db_dependent/selenium/basic_workflow.t b/t/db_dependent/selenium/basic_workflow.t >index 5f785d21df..044fdeb5b6 100644 >--- a/t/db_dependent/selenium/basic_workflow.t >+++ b/t/db_dependent/selenium/basic_workflow.t >@@ -72,7 +72,7 @@ our $sample_data = { > issuingrule => { > categorycode => 'test_cat', > itemtype => 'IT4test', >- branchcode => '*', >+ branchcode => undef, > maxissueqty => '5', > issuelength => '5', > lengthunit => 'days', >@@ -146,17 +146,18 @@ SKIP: { > time_diff("add biblio"); > > my $itemtype = $sample_data->{itemtype}; >- $dbh->do(q|INSERT INTO itemtypes (itemtype, description, rentalcharge, notforloan) VALUES (?, ?, ?, ?)|, undef, $itemtype->{itemtype}, $itemtype->{description}, $itemtype->{rentalcharge}, $itemtype->{notforloan}); > > my $issuing_rules = $sample_data->{issuingrule}; >- $dbh->do(q|INSERT INTO issuingrules (categorycode, itemtype, branchcode, issuelength, lengthunit, renewalperiod) VALUES (?, ?, ?, ?, ?, ?)|, undef, $issuing_rules->{categorycode}, $issuing_rules->{itemtype}, $issuing_rules->{branchcode}, $issuing_rules->{issuelength}, $issuing_rules->{lengthunit}, $issuing_rules->{renewalperiod}); > Koha::CirculationRules->set_rules( > { > categorycode => $issuing_rules->{categorycode}, > itemtype => $issuing_rules->{itemtype}, > branchcode => $issuing_rules->{branchcode}, > rules => { >- maxissueqty => $issuing_rules->{maxissueqty} >+ maxissueqty => $issuing_rules->{maxissueqty}, >+ issuelength => $issuing_rules->{issuelength}, >+ lengthunit => $issuing_rules->{lengthunit}, >+ renewalperiod => $issuing_rules->{renewalperiod}, > } > } > ); >@@ -245,7 +246,7 @@ sub cleanup { > $dbh->do(qq|DELETE FROM biblio WHERE title = "test biblio $i"|); > }; > $dbh->do(q|DELETE FROM itemtypes WHERE itemtype=?|, undef, $sample_data->{itemtype}{itemtype}); >- $dbh->do(q|DELETE FROM issuingrules WHERE categorycode=? AND itemtype=? AND branchcode=?|, undef, $sample_data->{issuingrule}{categorycode}, $sample_data->{issuingrule}{itemtype}, $sample_data->{issuingrule}{branchcode}); >+ $dbh->do(q|DELETE FROM circulation_rules WHERE categorycode=? AND itemtype=? AND branchcode=?|, undef, $sample_data->{issuingrule}{categorycode}, $sample_data->{issuingrule}{itemtype}, $sample_data->{issuingrule}{branchcode}); > } > > sub time_diff { >-- >2.11.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 18936
:
65247
|
65248
|
65249
|
67629
|
67758
|
68236
|
71034
|
71035
|
71036
|
71037
|
71038
|
71039
|
71040
|
71041
|
72230
|
72231
|
72232
|
72233
|
72234
|
72235
|
72236
|
72237
|
72238
|
91953
|
91954
|
91955
|
91956
|
91957
|
91958
|
91959
|
91960
|
91961
|
91962
|
91963
|
91964
|
91965
|
91966
|
91967
|
91968
|
91969
|
91970
|
91971
|
91972
|
91973
|
91974
|
91975
|
94179
|
94180
|
94181
|
94182
|
94183
|
94184
|
94185
|
94186
|
94187
|
94188
|
94189
|
94190
|
94191
|
94192
|
94193
|
94194
|
94195
|
94196
|
94197
|
94198
|
94199
|
94200
|
98299
|
98300
|
98301
|
98302
|
98303
|
98304
|
98305
|
98306
|
98307
|
98308
|
98309
|
98310
|
98311
|
98312
|
98313
|
98314
|
98315
|
98316
|
98317
|
98318
|
98319
|
98320
|
98321
|
98322
|
98323
|
98324
|
98325
|
98326
|
98327
|
98328
|
98329
|
98330
|
98331
|
98332
|
98333
|
98334
|
98335
|
98336
|
98337
|
98338
| 98339 |
98340
|
98341
|
98342
|
98343
|
98344
|
98345
|
98346
|
98347
|
98407
|
98408