forked from openfun/richie
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔧(search) add elastic search client custom settings
Add settings that permit to configure elastic search client with custom configuration like custom timeouts. Closes openfun#1613
- Loading branch information
Showing
4 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from django.test import TestCase | ||
from django.test.utils import override_settings | ||
from django.conf import settings | ||
from richie.apps.search import new_elasticsearch_client | ||
|
||
|
||
class IndexClientTestCase(TestCase): | ||
""" | ||
Test the index client extra vars | ||
""" | ||
|
||
@override_settings(RICHIE_ES_CLIENT_KWARGS={"timeout": 99}) | ||
def test_index_client_kwargs(self): | ||
""" | ||
Test `RICHIE_ES_CLIENT_KWARGS` setting, that allows to pass extra configurations to the | ||
elastic search index client. | ||
""" | ||
es_client_to_test = new_elasticsearch_client() | ||
self.assertEqual(es_client_to_test.transport.kwargs, {"timeout": 99}) |