File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 2525 }
2626else :
2727 db_settings = {
28- 'ENGINE' : 'django.db.backends.postgresql_psycopg2 ' ,
28+ 'ENGINE' : 'django.db.backends.postgresql ' ,
2929 'NAME' : 'binder-test' ,
3030 'HOST' : 'localhost' ,
3131 'USER' : 'postgres' ,
5151 'django.contrib.auth' ,
5252 'django.contrib.contenttypes' ,
5353 'django.contrib.sessions' ,
54+ * (
55+ ['django.contrib.postgres' ]
56+ if db_settings ['ENGINE' ] == 'django.db.backends.postgresql' else
57+ []
58+ ),
5459 'binder' ,
5560 'binder.plugins.token_auth' ,
5661 'tests' ,
116121# Do the dance to ensure the models are synched to the DB.
117122# This saves us from having to include migrations
118123from django .core .management .commands .migrate import Command as MigrationCommand # noqa
119- from django .db import connections # noqa
124+ from django .db import connection , connections # noqa
120125from django .db .migrations .executor import MigrationExecutor # noqa
121126
122127# This is oh so hacky....
132137Permission .objects .get_or_create (content_type = content_type , codename = 'view_country' )
133138call_command ('define_groups' )
134139
140+
141+ # Create postgres extensions
142+ if db_settings ['ENGINE' ] == 'django.db.backends.postgresql' :
143+ with connection .cursor () as cursor :
144+ cursor .execute ('CREATE EXTENSION IF NOT EXISTS unaccent;' )
You can’t perform that action at this time.
0 commit comments