Mercurial > gemma
comparison schema/manage_users_tests.sql @ 224:57dfab80973c
By convention, prefix all test users with 'test'
This allows to DROP them without having to fixup run_tests.sh
always after adding a new test user.
Further fixup of rev. cfde876fbaf9: Remove obsolete comment.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Wed, 25 Jul 2018 13:34:46 +0200 |
parents | 88d21c29cf04 |
children | 8b9cae6d3a21 |
comparison
equal
deleted
inserted
replaced
223:e9382dccb331 | 224:57dfab80973c |
---|---|
2 -- pgTAP test script for user management functions | 2 -- pgTAP test script for user management functions |
3 -- | 3 -- |
4 | 4 |
5 SET search_path TO public, gemma, gemma_waterway, gemma_fairway; | 5 SET search_path TO public, gemma, gemma_waterway, gemma_fairway; |
6 | 6 |
7 SET SESSION AUTHORIZATION admin_at; | 7 SET SESSION AUTHORIZATION test_admin_at; |
8 | 8 |
9 SELECT throws_ok($$ | 9 SELECT throws_ok($$ |
10 SELECT sys_admin.create_user( | 10 SELECT sys_admin.create_user( |
11 'waterway_user', 'test0', 'secret', 'AT', NULL, 'test0') | 11 'waterway_user', 'test0', 'secret', 'AT', NULL, 'test0') |
12 $$, | 12 $$, |
13 42501, NULL, | 13 42501, NULL, |
14 'Less privileged user cannot call function in schema sys_admin'); | 14 'Less privileged user cannot call function in schema sys_admin'); |
15 | 15 |
16 SET SESSION AUTHORIZATION sys_admin1; | 16 SET SESSION AUTHORIZATION test_sys_admin1; |
17 | 17 |
18 SELECT lives_ok($$ | 18 SELECT lives_ok($$ |
19 SELECT sys_admin.create_user( | 19 SELECT sys_admin.create_user( |
20 'waterway_user', 'test1', 'secret', 'AT', NULL, 'test1') | 20 'waterway_user', 'test1', 'secret', 'AT', NULL, 'test1') |
21 $$, | 21 $$, |
43 42710, NULL, | 43 42710, NULL, |
44 'Reserved role names cannot be used as username'); | 44 'Reserved role names cannot be used as username'); |
45 | 45 |
46 SELECT throws_ok($$ | 46 SELECT throws_ok($$ |
47 SELECT sys_admin.create_user( | 47 SELECT sys_admin.create_user( |
48 'waterway_user', 'user_at', 'secret', 'AT', NULL, 'test4') | 48 'waterway_user', 'test_user_at', 'secret', 'AT', NULL, 'test4') |
49 $$, | 49 $$, |
50 23505, NULL, | 50 23505, NULL, |
51 'No duplicate user name is allowed'); | 51 'No duplicate user name is allowed'); |
52 | 52 |
53 SELECT throws_ok($$ | 53 SELECT throws_ok($$ |