def setUp(self): settings.ELASTIC_INDEX = uuid.uuid4().hex settings.ELASTIC_TIMEOUT = 60 from website.search import elastic_search elastic_search.INDEX = settings.ELASTIC_INDEX elastic_search.create_index(settings.ELASTIC_INDEX) # NOTE: Super is called last to ensure the ES connection can be established before # the httpretty module patches the socket. super(SearchTestCase, self).setUp()
def setUp(self): settings.ELASTIC_INDEX = uuid.uuid4().hex settings.ELASTIC_TIMEOUT = 60 from website.search import elastic_search elastic_search.INDEX = settings.ELASTIC_INDEX elastic_search.create_index(settings.ELASTIC_INDEX) # NOTE: Super is called last to ensure the ES connection can be established before # the httpretty module patches the socket. super(SearchTestCase, self).setUp()
def create_index(index=None): index = index or settings.ELASTIC_INDEX search_engine.create_index(index=index)