コード例 #1
0
ファイル: base.py プロジェクト: leb2dg/osf.io
    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()
コード例 #2
0
    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()
コード例 #3
0
def create_index(index=None):
    index = index or settings.ELASTIC_INDEX
    search_engine.create_index(index=index)