40 lines
1.6 KiB
PL/PgSQL
40 lines
1.6 KiB
PL/PgSQL
-- Test invoice_product_product
|
|
set client_min_messages to warning;
|
|
create extension if not exists pgtap;
|
|
reset client_min_messages;
|
|
|
|
begin;
|
|
|
|
select plan(19);
|
|
|
|
set search_path to camper, public;
|
|
|
|
select has_table('invoice_product_product');
|
|
select has_pk('invoice_product_product' );
|
|
select table_privs_are('invoice_product_product', 'guest', array []::text[]);
|
|
select table_privs_are('invoice_product_product', 'employee', array ['SELECT', 'INSERT', 'UPDATE', 'DELETE']);
|
|
select table_privs_are('invoice_product_product', 'admin', array ['SELECT', 'INSERT', 'UPDATE', 'DELETE']);
|
|
select table_privs_are('invoice_product_product', 'authenticator', array []::text[]);
|
|
|
|
select has_column('invoice_product_product', 'invoice_product_id');
|
|
select col_is_pk('invoice_product_product', 'invoice_product_id');
|
|
select col_is_fk('invoice_product_product', 'invoice_product_id');
|
|
select fk_ok('invoice_product_product', 'invoice_product_id', 'invoice_product', 'invoice_product_id');
|
|
select col_type_is('invoice_product_product', 'invoice_product_id', 'integer');
|
|
select col_not_null('invoice_product_product', 'invoice_product_id');
|
|
select col_hasnt_default('invoice_product_product', 'invoice_product_id');
|
|
|
|
select has_column('invoice_product_product', 'product_id');
|
|
select col_is_fk('invoice_product_product', 'product_id');
|
|
select fk_ok('invoice_product_product', 'product_id', 'product', 'product_id');
|
|
select col_type_is('invoice_product_product', 'product_id', 'integer');
|
|
select col_not_null('invoice_product_product', 'product_id');
|
|
select col_hasnt_default('invoice_product_product', 'product_id');
|
|
|
|
|
|
select *
|
|
from finish();
|
|
|
|
rollback;
|
|
|