I have a django powered website that uses sphinxsearch for searching and querying. The Django testing platform creates a test database against which all your test cases are tested. However my original sphinx indexer would still be indexing the original db. I wanted to know whats the best strategy to tackle this issue. I would love to know about some existing django app to solve this problem or to get some pointers about how to go about this issue.
Asked
Active
Viewed 166 times
0
-
how your settings.py file looks ? – Priyank Patel May 16 '12 at 07:30
1 Answers
1
Not much you have to do: Change the settings of sphinx when you run a test. If you specify the sphinx settings in your django project.settings file you would have to do this:
- create a sphinx testdatabase
- create a settings.py specifically for testing
- python ./manage.py test --settings=project.sphinxtest.settings
If you specifiy your sphinx settings elsewhere, do something similar. Important is to use different settings for sphinx while testing, as there you specify the database sphinx should use.
Without more details about your implementation, this is the most that can be said to help you...

marue
- 5,588
- 7
- 37
- 65
-
from what i understood I need to have a seperate sphinx settings file for testing that runs on the test database? In that case I would also need to run the indexer as a setup step before running any of my testcase. Wouldn't that really slow down the testcases? – Ritesh Kadmawala May 16 '12 at 10:02
-
Probably, yes. But does performance really matter that much for your tests? You do not have 4000 users running your tests simultaneously (as you have users using your website), so that shouldn't be too much of an issue. Before diving into performance issues, do some working code. If it really is an issue, do performance optimization later. By the way: in your case you will not have a choice, as far as i can see. – marue May 16 '12 at 10:25