From 3203abfbb73465d3a2cd1082eef0563b1a700d1c Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 5 Oct 2016 12:59:00 -0400 Subject: [PATCH] LP#1596595 Adds sample metarecord hold to concerto Adds a holdable_formats option to concerto's populate_hold() function. Inserts one metarecord hold for testing. Signed-off-by: Bill Erickson Signed-off-by: Chris Sharp Signed-off-by: Kathy Lussier --- Open-ILS/tests/datasets/sql/env_create.sql | 8 +++++--- Open-ILS/tests/datasets/sql/env_destroy.sql | 2 +- Open-ILS/tests/datasets/sql/transactions.sql | 8 ++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Open-ILS/tests/datasets/sql/env_create.sql b/Open-ILS/tests/datasets/sql/env_create.sql index ad5ba856aa..07dae6d9ec 100644 --- a/Open-ILS/tests/datasets/sql/env_create.sql +++ b/Open-ILS/tests/datasets/sql/env_create.sql @@ -186,12 +186,13 @@ CREATE FUNCTION evergreen.populate_hold ( requestor INTEGER, pickup_lib INTEGER, frozen BOOLEAN, - thawdate TIMESTAMP WITH TIME ZONE + thawdate TIMESTAMP WITH TIME ZONE, + holdable_formats TEXT DEFAULT NULL ) RETURNS void AS $$ BEGIN INSERT INTO action.hold_request ( requestor, hold_type, target, usr, pickup_lib, - request_lib, selection_ou, frozen, thaw_date) + request_lib, selection_ou, frozen, thaw_date, holdable_formats) VALUES ( requestor, hold_type, @@ -201,7 +202,8 @@ BEGIN pickup_lib, pickup_lib, frozen, - thawdate + thawdate, + holdable_formats ); -- Create hold notes for staff-placed holds: 1 public, 1 private diff --git a/Open-ILS/tests/datasets/sql/env_destroy.sql b/Open-ILS/tests/datasets/sql/env_destroy.sql index 9b51ab7f97..9f69865f87 100644 --- a/Open-ILS/tests/datasets/sql/env_destroy.sql +++ b/Open-ILS/tests/datasets/sql/env_destroy.sql @@ -11,5 +11,5 @@ DROP FUNCTION evergreen.next_bib (BIGINT); DROP FUNCTION evergreen.populate_circ (INTEGER, INTEGER, BIGINT, INTEGER, TEXT, TEXT, TEXT, BOOLEAN); DROP FUNCTION evergreen.populate_hold - (TEXT, BIGINT, INTEGER, INTEGER, INTEGER, BOOLEAN, TIMESTAMP WITH TIME ZONE); + (TEXT, BIGINT, INTEGER, INTEGER, INTEGER, BOOLEAN, TIMESTAMP WITH TIME ZONE, TEXT); diff --git a/Open-ILS/tests/datasets/sql/transactions.sql b/Open-ILS/tests/datasets/sql/transactions.sql index e95b0d60d0..cb9a73c699 100644 --- a/Open-ILS/tests/datasets/sql/transactions.sql +++ b/Open-ILS/tests/datasets/sql/transactions.sql @@ -136,6 +136,14 @@ BEGIN END LOOP; END LOOP; + + -- finally, add a metarecord hold w/ a holdable_format + -- for patron id=2 (home_ou=9) + PERFORM evergreen.populate_hold( + 'M', 42, 2, 2, 9, FALSE, NULL, + '{"0":[{"_attr":"mr_hold_format","_val":"score"}]}' + ); + END $$; -- 2.43.2