comparison schema/auth_tests.sql @ 196:b67208d82543

Make test output more comprehensive Running all tests in one transaction ensures the final output tells about any failing test, not just in the last transaction (i.e. test script). The price is that no traces of the tests are left in the database because we have to rollback in order to have no left-over test roles in the cluster.
author Tom Gottfried <tom@intevation.de>
date Fri, 20 Jul 2018 18:31:45 +0200
parents 5dc8e734487a
children 88d21c29cf04
comparison
equal deleted inserted replaced
195:5dc8e734487a 196:b67208d82543
1 -- 1 --
2 -- pgTAP test script for privileges and RLS policies 2 -- pgTAP test script for privileges and RLS policies
3 -- 3 --
4 SELECT plan(16); -- Give number of tests that have to be run
5 4
6 -- 5 --
7 -- Run tests as unprivileged user 6 -- Run tests as unprivileged user
8 -- 7 --
9 SET SESSION AUTHORIZATION waterway_user; 8 SET SESSION AUTHORIZATION waterway_user;
88 'Waterway admin can delete templates for own country'); 87 'Waterway admin can delete templates for own country');
89 88
90 SELECT is_empty('DELETE FROM users.templates WHERE template_name = ''RO'' 89 SELECT is_empty('DELETE FROM users.templates WHERE template_name = ''RO''
91 RETURNING *', 90 RETURNING *',
92 'Waterway admin cannot delete templates for other country'); 91 'Waterway admin cannot delete templates for other country');
93
94 --
95 -- finish tests
96 --
97 SELECT * FROM finish();