From 2fb0fb38e213177f47156437ccefc90174009d0b Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 18 Aug 2015 10:31:50 -0400 Subject: [PATCH] LP#1440114 Blanket order pgtap tests Signed-off-by: Bill Erickson Signed-off-by: Kathy Lussier --- Open-ILS/src/sql/Pg/t/blanket_order.pg | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Open-ILS/src/sql/Pg/t/blanket_order.pg diff --git a/Open-ILS/src/sql/Pg/t/blanket_order.pg b/Open-ILS/src/sql/Pg/t/blanket_order.pg new file mode 100644 index 0000000000..6f536dc3e3 --- /dev/null +++ b/Open-ILS/src/sql/Pg/t/blanket_order.pg @@ -0,0 +1,28 @@ +BEGIN; + +SELECT plan(3); + +SELECT has_column('acq', 'invoice_item_type', + 'blanket', '"blanket" column created'); + +-- A type cannot be both blanket and prorate + +SELECT throws_ok( + 'INSERT INTO acq.invoice_item_type + (code, name, prorate, blanket) VALUES (''foo'', ''foo'', TRUE, TRUE)', + 23514 -- check_violation +); + +SELECT is( + (SELECT blanket FROM acq.invoice_item_type WHERE code = 'BLA'), + TRUE, + 'New item type is set to blanket=TRUE' +); + + +SELECT * FROM finish(); + +ROLLBACK; + + + -- 2.11.0