test: Add a missing PGroonga configuration

Fix #1769
This commit is contained in:
Kouhei Sutou
2016-09-19 01:03:43 +09:00
parent 8ae7e7b451
commit e80279c2e4

View File

@@ -10,6 +10,15 @@ DATABASES["default"] = {"NAME": "zulip_test",
"ENGINE": "django.db.backends.postgresql_psycopg2",
"TEST_NAME": "django_zulip_tests",
"OPTIONS": {"connection_factory": TimeTrackingConnection },}
if USING_PGROONGA:
# We need to have "pgroonga" schema before "pg_catalog" schema in
# the PostgreSQL search path, because "pgroonga" schema overrides
# the "@@" operator from "pg_catalog" schema, and "pg_catalog"
# schema is searched first if not specified in the search path.
# See also: http://www.postgresql.org/docs/current/static/runtime-config-client.html
pg_options = '-c search_path=%(SCHEMA)s,zulip,public,pgroonga,pg_catalog' % \
DATABASES['default']
DATABASES['default']['OPTIONS']['options'] = pg_options
# In theory this should just go in zproject/settings.py inside the `if
# PIPELINE_ENABLED` statement, but because zproject/settings.py is processed