2018-02-22 18:20:16 +08:00
|
|
|
-- Only show warning or error messages in the tests output
|
|
|
|
SET client_min_messages TO WARNING;
|
2015-11-10 22:28:12 +08:00
|
|
|
-- Install dependencies
|
|
|
|
CREATE EXTENSION postgis;
|
2020-02-24 23:12:27 +08:00
|
|
|
CREATE EXTENSION @@plpythonu@@;
|
2015-11-17 19:01:18 +08:00
|
|
|
CREATE EXTENSION cartodb;
|
2015-11-10 22:28:12 +08:00
|
|
|
CREATE EXTENSION plproxy;
|
|
|
|
-- Install the extension
|
2016-02-06 00:57:56 +08:00
|
|
|
CREATE EXTENSION cdb_dataservices_client;
|
2015-11-12 01:52:48 +08:00
|
|
|
-- Mock the server connection to point to this very test db
|
2015-11-17 19:01:18 +08:00
|
|
|
SELECT cartodb.cdb_conf_setconf('geocoder_server_config', '{"connection_str": "dbname=contrib_regression host=127.0.0.1 user=postgres"}');
|
|
|
|
cdb_conf_setconf
|
|
|
|
------------------
|
2015-11-12 01:52:48 +08:00
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
2015-11-20 17:51:19 +08:00
|
|
|
-- Mock the user configuration
|
|
|
|
SELECT cartodb.cdb_conf_setconf('user_config', '{"is_organization": false, "entity_name": "test_user"}');
|
|
|
|
cdb_conf_setconf
|
|
|
|
------------------
|
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
2015-11-12 01:52:48 +08:00
|
|
|
-- Mock the server schema
|
2016-02-06 00:57:56 +08:00
|
|
|
CREATE SCHEMA cdb_dataservices_server;
|
2015-11-12 03:22:59 +08:00
|
|
|
-- Create a test user to check permissions
|
|
|
|
DROP ROLE IF EXISTS test_regular_user;
|
|
|
|
CREATE ROLE test_regular_user;
|
|
|
|
GRANT publicuser TO test_regular_user;
|
2016-02-06 00:57:56 +08:00
|
|
|
ALTER ROLE test_regular_user SET search_path TO public,cartodb,cdb_dataservices_client;
|