-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Add missing test coverage for full text search filter #9949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,8 @@ | ||||||||||||||||||||
| import os | ||||||||||||||||||||
|
|
||||||||||||||||||||
| import dj_database_url | ||||||||||||||||||||
| import django | ||||||||||||||||||||
| import pytest | ||||||||||||||||||||
| from django.core import management | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
|
||||||||||||||||||||
|
|
@@ -13,19 +15,27 @@ def pytest_addoption(parser): | |||||||||||||||||||
| def pytest_configure(config): | ||||||||||||||||||||
| from django.conf import settings | ||||||||||||||||||||
|
|
||||||||||||||||||||
| settings.configure( | ||||||||||||||||||||
| DEBUG_PROPAGATE_EXCEPTIONS=True, | ||||||||||||||||||||
| DEFAULT_AUTO_FIELD="django.db.models.AutoField", | ||||||||||||||||||||
| DATABASES={ | ||||||||||||||||||||
| if os.getenv('DATABASE_URL'): | ||||||||||||||||||||
| databases = { | ||||||||||||||||||||
| 'default': dj_database_url.config(), | ||||||||||||||||||||
| 'secondary': dj_database_url.config(), | ||||||||||||||||||||
|
Comment on lines
+19
to
+21
|
||||||||||||||||||||
| databases = { | |
| 'default': dj_database_url.config(), | |
| 'secondary': dj_database_url.config(), | |
| default_database = dj_database_url.config() | |
| secondary_database = default_database.copy() | |
| secondary_database['TEST'] = {'MIRROR': 'default'} | |
| databases = { | |
| 'default': default_database, | |
| 'secondary': secondary_database, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This CI step creates the
unaccentextension in thepostgresdatabase, but Django/pytest will run tests against a newly created test database (e.g.test_postgres), which will not automatically inherit extensions from the original DB. Ifunaccentis needed for tests, create it in the test DB during test setup (e.g. in a pytest fixture after DB creation) or create it in a template DB used for test DB creation.