Skip to content

Commit ce48c88

Browse files
committed
chore(AlgoliaEngine.reset): update readme
1 parent 65350a5 commit ce48c88

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,5 +259,22 @@ To run the tests, first find your Algolia application id and Admin API key (foun
259259
ALGOLIA_APPLICATION_ID={APPLICATION_ID} ALGOLIA_API_KEY={ADMIN_API_KEY} tox
260260
```
261261

262+
To override settings for some tests, use the [settings method](https://docs.djangoproject.com/en/1.11/topics/testing/tools/#django.test.SimpleTestCase.settings):
263+
```python
264+
class OverrideSettingsTestCase(TestCase):
265+
def setUp(self):
266+
with self.settings(ALGOLIA={
267+
'APPLICATION_ID': 'foo',
268+
'API_KEY': 'bar',
269+
'AUTO_INDEXING': False
270+
}):
271+
algolia_engine.reset(settings.ALGOLIA)
272+
273+
def tearDown(self):
274+
algolia_engine.reset(settings.ALGOLIA)
275+
276+
def test_foo():
277+
# ...
278+
```
262279

263280

0 commit comments

Comments
 (0)