To be concrete, I've tried to change production database with test one in UnitTests by changing the value of ELASTICSEARCH_DEFAULT_INDEX variable. The problem is, that EsIndexable.Elasticsearch.index is substituted from settings only once on class creation, and any changes in django.settings doesn't affect it. The solution is writing dynamic property.
I'm not sure, but this problem may also occure with other SETTING's variables.
To be concrete, I've tried to change production database with test one in UnitTests by changing the value of
ELASTICSEARCH_DEFAULT_INDEX
variable. The problem is, thatEsIndexable.Elasticsearch.index
is substituted from settings only once on class creation, and any changes in django.settings doesn't affect it. The solution is writing dynamic property. I'm not sure, but this problem may also occure with other SETTING's variables.