-- Test quote_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 numerus, public;

select has_table('quote_product_product');
select has_pk('quote_product_product' );
select table_privs_are('quote_product_product', 'guest', array []::text[]);
select table_privs_are('quote_product_product', 'invoicer', array ['SELECT', 'INSERT', 'UPDATE', 'DELETE']);
select table_privs_are('quote_product_product', 'admin', array ['SELECT', 'INSERT', 'UPDATE', 'DELETE']);
select table_privs_are('quote_product_product', 'authenticator', array []::text[]);

select has_column('quote_product_product', 'quote_product_id');
select col_is_pk('quote_product_product', 'quote_product_id');
select col_is_fk('quote_product_product', 'quote_product_id');
select fk_ok('quote_product_product', 'quote_product_id', 'quote_product', 'quote_product_id');
select col_type_is('quote_product_product', 'quote_product_id', 'integer');
select col_not_null('quote_product_product', 'quote_product_id');
select col_hasnt_default('quote_product_product', 'quote_product_id');

select has_column('quote_product_product', 'product_id');
select col_is_fk('quote_product_product', 'product_id');
select fk_ok('quote_product_product', 'product_id', 'product', 'product_id');
select col_type_is('quote_product_product', 'product_id', 'integer');
select col_not_null('quote_product_product', 'product_id');
select col_hasnt_default('quote_product_product', 'product_id');


select *
from finish();

rollback;

