Django View Unit Tests when the View Accesses an Elasticsearch Index
There are a couple of different ways that could handle this:

Stub out the loading of Elasticsearch depedency dynamically using unittest.patch
Create some sort of "seam" into your view that allows the test to import the view and replace the elasticsearch class with a test implementation
Define the elastic search class in settings as a module path and switch it out for the test runs (django actually does this with a lot of its depdendencies)
I have a Django view where a user fills out and submits a form. The data is taken from this form and a document is created in an Elasticsearch index.
My question, is how can I test this view without impacting my Elasticsearch index? It is a development index, but I would prefer not to muddle it with unit test data.
One option would be to create the record in the unit test and then delete it during tear down - but, if possible, I would really like to avoid touching the index at all. 
Are there any other options?