numerus/test/quote_payment_method.sql

40 lines
1.5 KiB
PL/PgSQL

-- Test quote_payment_method
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_payment_method');
select has_pk('quote_payment_method' );
select table_privs_are('quote_payment_method', 'guest', array []::text[]);
select table_privs_are('quote_payment_method', 'invoicer', array ['SELECT', 'INSERT', 'UPDATE', 'DELETE']);
select table_privs_are('quote_payment_method', 'admin', array ['SELECT', 'INSERT', 'UPDATE', 'DELETE']);
select table_privs_are('quote_payment_method', 'authenticator', array []::text[]);
select has_column('quote_payment_method', 'quote_id');
select col_is_pk('quote_payment_method', 'quote_id');
select col_is_fk('quote_payment_method', 'quote_id');
select fk_ok('quote_payment_method', 'quote_id', 'quote', 'quote_id');
select col_type_is('quote_payment_method', 'quote_id', 'integer');
select col_not_null('quote_payment_method', 'quote_id');
select col_hasnt_default('quote_payment_method', 'quote_id');
select has_column('quote_payment_method', 'payment_method_id');
select col_is_fk('quote_payment_method', 'payment_method_id');
select fk_ok('quote_payment_method', 'payment_method_id', 'payment_method', 'payment_method_id');
select col_type_is('quote_payment_method', 'payment_method_id', 'integer');
select col_not_null('quote_payment_method', 'payment_method_id');
select col_hasnt_default('quote_payment_method', 'payment_method_id');
select *
from finish();
rollback;