Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Remove legacy code from tests

Jakub Draganekdab47599e3ef
diff --git a/tests/cassettes/test_index_products.yaml b/tests/cassettes/test_index_products.yaml
deleted file mode 100644
index a317426f6a..0000000000
--- a/tests/cassettes/test_index_products.yaml
+++ /dev/null
@@ -1,691 +0,0 @@
-interactions:
-- request:
- body: null
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: DELETE
- uri: http://search:9200/storefront__userprofile_user
- response:
- body: {string: '{"acknowledged":true}'}
- headers:
- content-length: ['21']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"settings": {"analysis": {"tokenizer": {"edgengram_tokenizer": {"type":
- "edgeNGram", "min_gram": 2, "max_gram": 15, "side": "front"}, "ngram_tokenizer":
- {"type": "nGram", "min_gram": 3, "max_gram": 15}}, "filter": {"edgengram": {"type":
- "edgeNGram", "min_gram": 1, "max_gram": 15}, "ngram": {"type": "nGram", "min_gram":
- 3, "max_gram": 15}}, "analyzer": {"edgengram_analyzer": {"tokenizer": "lowercase",
- "type": "custom", "filter": ["asciifolding", "edgengram"]}, "ngram_analyzer":
- {"tokenizer": "lowercase", "type": "custom", "filter": ["asciifolding", "ngram"]}}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: PUT
- uri: http://search:9200/storefront__userprofile_user
- response:
- body: {string: '{"acknowledged":true,"shards_acknowledged":true}'}
- headers:
- content-length: ['48']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"userprofile_user": {"properties": {"_partials": {"type": "text", "search_analyzer":
- "standard", "analyzer": "edgengram_analyzer", "include_in_all": false}, "pk":
- {"store": true, "type": "keyword", "include_in_all": false}, "email": {"type":
- "text", "include_in_all": true}, "content_type": {"type": "keyword", "include_in_all":
- false}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: PUT
- uri: http://search:9200/storefront__userprofile_user/_mapping/userprofile_user?update_all_types=true
- response:
- body: {string: '{"acknowledged":true}'}
- headers:
- Warning: ['299 Elasticsearch-5.4.3-eed30a8 "field [include_in_all] is deprecated,
- as [_all] is deprecated, and will be disallowed in 6.0, use [copy_to] instead."
- "Mon, 16 Oct 2017 11:46:08 GMT"']
- content-length: ['21']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: null
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: POST
- uri: http://search:9200/storefront__userprofile_user/_refresh
- response:
- body: {string: '{"_shards":{"total":10,"successful":5,"failed":0}}'}
- headers:
- content-length: ['50']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: null
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: DELETE
- uri: http://search:9200/storefront__product_product
- response:
- body: {string: '{"acknowledged":true}'}
- headers:
- content-length: ['21']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"settings": {"analysis": {"tokenizer": {"edgengram_tokenizer": {"type":
- "edgeNGram", "min_gram": 2, "max_gram": 15, "side": "front"}, "ngram_tokenizer":
- {"type": "nGram", "min_gram": 3, "max_gram": 15}}, "filter": {"edgengram": {"type":
- "edgeNGram", "min_gram": 1, "max_gram": 15}, "ngram": {"type": "nGram", "min_gram":
- 3, "max_gram": 15}}, "analyzer": {"edgengram_analyzer": {"tokenizer": "lowercase",
- "type": "custom", "filter": ["asciifolding", "edgengram"]}, "ngram_analyzer":
- {"tokenizer": "lowercase", "type": "custom", "filter": ["asciifolding", "ngram"]}}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: PUT
- uri: http://search:9200/storefront__product_product
- response:
- body: {string: '{"acknowledged":true,"shards_acknowledged":true}'}
- headers:
- content-length: ['48']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"product_product": {"properties": {"name": {"type": "text", "include_in_all":
- true, "analyzer": "edgengram_analyzer", "search_analyzer": "standard"}, "is_published_filter":
- {"type": "boolean", "include_in_all": false}, "pk": {"store": true, "type":
- "keyword", "include_in_all": false}, "available_on_filter": {"type": "date",
- "include_in_all": false}, "_partials": {"type": "text", "search_analyzer": "standard",
- "analyzer": "edgengram_analyzer", "include_in_all": false}, "content_type":
- {"type": "keyword", "include_in_all": false}, "description": {"type": "text",
- "include_in_all": true}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: PUT
- uri: http://search:9200/storefront__product_product/_mapping/product_product?update_all_types=true
- response:
- body: {string: '{"acknowledged":true}'}
- headers:
- Warning: ['299 Elasticsearch-5.4.3-eed30a8 "field [include_in_all] is deprecated,
- as [_all] is deprecated, and will be disallowed in 6.0, use [copy_to] instead."
- "Mon, 16 Oct 2017 11:46:08 GMT"']
- content-length: ['21']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"index": {"_id": "product_product:1", "_type": "product_product", "_index":
- "storefront__product_product"}}
-
- {"name": "Test product 1", "content_type": ["product.Product"], "description":
- "", "is_published_filter": true, "pk": "1", "available_on_filter": null, "_partials":
- ["Test product 1"]}
-
- {"index": {"_id": "product_product:2", "_type": "product_product", "_index":
- "storefront__product_product"}}
-
- {"name": "Test product 2", "content_type": ["product.Product"], "description":
- "", "is_published_filter": true, "pk": "2", "available_on_filter": null, "_partials":
- ["Test product 2"]}
-
-'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: POST
- uri: http://search:9200/_bulk
- response:
- body: {string: '{"took":5,"errors":false,"items":[{"index":{"_index":"storefront__product_product","_type":"product_product","_id":"product_product:1","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"created":true,"status":201}},{"index":{"_index":"storefront__product_product","_type":"product_product","_id":"product_product:2","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"created":true,"status":201}}]}'}
- headers:
- content-length: ['457']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: null
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: POST
- uri: http://search:9200/storefront__product_product/_refresh
- response:
- body: {string: '{"_shards":{"total":10,"successful":5,"failed":0}}'}
- headers:
- content-length: ['50']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: null
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: DELETE
- uri: http://search:9200/storefront__order_order
- response:
- body: {string: '{"acknowledged":true}'}
- headers:
- content-length: ['21']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"settings": {"analysis": {"tokenizer": {"edgengram_tokenizer": {"type":
- "edgeNGram", "min_gram": 2, "max_gram": 15, "side": "front"}, "ngram_tokenizer":
- {"type": "nGram", "min_gram": 3, "max_gram": 15}}, "filter": {"edgengram": {"type":
- "edgeNGram", "min_gram": 1, "max_gram": 15}, "ngram": {"type": "nGram", "min_gram":
- 3, "max_gram": 15}}, "analyzer": {"edgengram_analyzer": {"tokenizer": "lowercase",
- "type": "custom", "filter": ["asciifolding", "edgengram"]}, "ngram_analyzer":
- {"tokenizer": "lowercase", "type": "custom", "filter": ["asciifolding", "ngram"]}}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: PUT
- uri: http://search:9200/storefront__order_order
- response:
- body: {string: '{"acknowledged":true,"shards_acknowledged":true}'}
- headers:
- content-length: ['48']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"order_order": {"properties": {"_index_shipping_phone": {"type": "text",
- "include_in_all": true}, "get_user_current_email": {"type": "text", "include_in_all":
- true}, "pk": {"store": true, "type": "keyword", "include_in_all": false}, "_partials":
- {"type": "text", "search_analyzer": "standard", "analyzer": "edgengram_analyzer",
- "include_in_all": false}, "id": {"type": "integer", "include_in_all": true},
- "content_type": {"type": "keyword", "include_in_all": false}, "_index_billing_phone":
- {"type": "text", "include_in_all": true}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: PUT
- uri: http://search:9200/storefront__order_order/_mapping/order_order?update_all_types=true
- response:
- body: {string: '{"acknowledged":true}'}
- headers:
- Warning: ['299 Elasticsearch-5.4.3-eed30a8 "field [include_in_all] is deprecated,
- as [_all] is deprecated, and will be disallowed in 6.0, use [copy_to] instead."
- "Mon, 16 Oct 2017 11:46:09 GMT"']
- content-length: ['21']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: null
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: POST
- uri: http://search:9200/storefront__order_order/_refresh
- response:
- body: {string: '{"_shards":{"total":10,"successful":5,"failed":0}}'}
- headers:
- content-length: ['50']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: null
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: DELETE
- uri: http://search:9200/storefront__userprofile_user
- response:
- body: {string: '{"acknowledged":true}'}
- headers:
- content-length: ['21']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"settings": {"analysis": {"tokenizer": {"edgengram_tokenizer": {"type":
- "edgeNGram", "min_gram": 2, "max_gram": 15, "side": "front"}, "ngram_tokenizer":
- {"type": "nGram", "min_gram": 3, "max_gram": 15}}, "filter": {"edgengram": {"type":
- "edgeNGram", "min_gram": 1, "max_gram": 15}, "ngram": {"type": "nGram", "min_gram":
- 3, "max_gram": 15}}, "analyzer": {"edgengram_analyzer": {"tokenizer": "lowercase",
- "type": "custom", "filter": ["asciifolding", "edgengram"]}, "ngram_analyzer":
- {"tokenizer": "lowercase", "type": "custom", "filter": ["asciifolding", "ngram"]}}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: PUT
- uri: http://search:9200/storefront__userprofile_user
- response:
- body: {string: '{"acknowledged":true,"shards_acknowledged":true}'}
- headers:
- content-length: ['48']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"userprofile_user": {"properties": {"_partials": {"type": "text", "search_analyzer":
- "standard", "analyzer": "edgengram_analyzer", "include_in_all": false}, "pk":
- {"store": true, "type": "keyword", "include_in_all": false}, "email": {"type":
- "text", "include_in_all": true}, "content_type": {"type": "keyword", "include_in_all":
- false}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: PUT
- uri: http://search:9200/storefront__userprofile_user/_mapping/userprofile_user?update_all_types=true
- response:
- body: {string: '{"acknowledged":true}'}
- headers:
- Warning: ['299 Elasticsearch-5.4.3-eed30a8 "field [include_in_all] is deprecated,
- as [_all] is deprecated, and will be disallowed in 6.0, use [copy_to] instead."
- "Mon, 16 Oct 2017 11:46:09 GMT"']
- content-length: ['21']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: null
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: POST
- uri: http://search:9200/storefront__userprofile_user/_refresh
- response:
- body: {string: '{"_shards":{"total":10,"successful":5,"failed":0}}'}
- headers:
- content-length: ['50']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: null
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: DELETE
- uri: http://search:9200/storefront__product_product
- response:
- body: {string: '{"acknowledged":true}'}
- headers:
- content-length: ['21']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"settings": {"analysis": {"tokenizer": {"edgengram_tokenizer": {"type":
- "edgeNGram", "min_gram": 2, "max_gram": 15, "side": "front"}, "ngram_tokenizer":
- {"type": "nGram", "min_gram": 3, "max_gram": 15}}, "filter": {"edgengram": {"type":
- "edgeNGram", "min_gram": 1, "max_gram": 15}, "ngram": {"type": "nGram", "min_gram":
- 3, "max_gram": 15}}, "analyzer": {"edgengram_analyzer": {"tokenizer": "lowercase",
- "type": "custom", "filter": ["asciifolding", "edgengram"]}, "ngram_analyzer":
- {"tokenizer": "lowercase", "type": "custom", "filter": ["asciifolding", "ngram"]}}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: PUT
- uri: http://search:9200/storefront__product_product
- response:
- body: {string: '{"acknowledged":true,"shards_acknowledged":true}'}
- headers:
- content-length: ['48']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"product_product": {"properties": {"name": {"type": "text", "include_in_all":
- true, "analyzer": "edgengram_analyzer", "search_analyzer": "standard"}, "is_published_filter":
- {"type": "boolean", "include_in_all": false}, "pk": {"store": true, "type":
- "keyword", "include_in_all": false}, "available_on_filter": {"type": "date",
- "include_in_all": false}, "_partials": {"type": "text", "search_analyzer": "standard",
- "analyzer": "edgengram_analyzer", "include_in_all": false}, "content_type":
- {"type": "keyword", "include_in_all": false}, "description": {"type": "text",
- "include_in_all": true}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: PUT
- uri: http://search:9200/storefront__product_product/_mapping/product_product?update_all_types=true
- response:
- body: {string: '{"acknowledged":true}'}
- headers:
- Warning: ['299 Elasticsearch-5.4.3-eed30a8 "field [include_in_all] is deprecated,
- as [_all] is deprecated, and will be disallowed in 6.0, use [copy_to] instead."
- "Mon, 16 Oct 2017 11:46:09 GMT"']
- content-length: ['21']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"index": {"_id": "product_product:1", "_type": "product_product", "_index":
- "storefront__product_product"}}
-
- {"name": "Test product 1", "content_type": ["product.Product"], "description":
- "", "is_published_filter": true, "pk": "1", "available_on_filter": null, "_partials":
- ["Test product 1"]}
-
- {"index": {"_id": "product_product:2", "_type": "product_product", "_index":
- "storefront__product_product"}}
-
- {"name": "Test product 2", "content_type": ["product.Product"], "description":
- "", "is_published_filter": true, "pk": "2", "available_on_filter": null, "_partials":
- ["Test product 2"]}
-
-'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: POST
- uri: http://search:9200/_bulk
- response:
- body: {string: '{"took":5,"errors":false,"items":[{"index":{"_index":"storefront__product_product","_type":"product_product","_id":"product_product:1","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"created":true,"status":201}},{"index":{"_index":"storefront__product_product","_type":"product_product","_id":"product_product:2","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"created":true,"status":201}}]}'}
- headers:
- content-length: ['457']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: null
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: POST
- uri: http://search:9200/storefront__product_product/_refresh
- response:
- body: {string: '{"_shards":{"total":10,"successful":5,"failed":0}}'}
- headers:
- content-length: ['50']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: null
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: DELETE
- uri: http://search:9200/storefront__order_order
- response:
- body: {string: '{"acknowledged":true}'}
- headers:
- content-length: ['21']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"settings": {"analysis": {"tokenizer": {"edgengram_tokenizer": {"type":
- "edgeNGram", "min_gram": 2, "max_gram": 15, "side": "front"}, "ngram_tokenizer":
- {"type": "nGram", "min_gram": 3, "max_gram": 15}}, "filter": {"edgengram": {"type":
- "edgeNGram", "min_gram": 1, "max_gram": 15}, "ngram": {"type": "nGram", "min_gram":
- 3, "max_gram": 15}}, "analyzer": {"edgengram_analyzer": {"tokenizer": "lowercase",
- "type": "custom", "filter": ["asciifolding", "edgengram"]}, "ngram_analyzer":
- {"tokenizer": "lowercase", "type": "custom", "filter": ["asciifolding", "ngram"]}}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: PUT
- uri: http://search:9200/storefront__order_order
- response:
- body: {string: '{"acknowledged":true,"shards_acknowledged":true}'}
- headers:
- content-length: ['48']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"order_order": {"properties": {"_index_shipping_phone": {"type": "text",
- "include_in_all": true}, "get_user_current_email": {"type": "text", "include_in_all":
- true}, "pk": {"store": true, "type": "keyword", "include_in_all": false}, "_partials":
- {"type": "text", "search_analyzer": "standard", "analyzer": "edgengram_analyzer",
- "include_in_all": false}, "id": {"type": "integer", "include_in_all": true},
- "content_type": {"type": "keyword", "include_in_all": false}, "_index_billing_phone":
- {"type": "text", "include_in_all": true}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: PUT
- uri: http://search:9200/storefront__order_order/_mapping/order_order?update_all_types=true
- response:
- body: {string: '{"acknowledged":true}'}
- headers:
- Warning: ['299 Elasticsearch-5.4.3-eed30a8 "field [include_in_all] is deprecated,
- as [_all] is deprecated, and will be disallowed in 6.0, use [copy_to] instead."
- "Mon, 16 Oct 2017 11:46:09 GMT"']
- content-length: ['21']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: null
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: POST
- uri: http://search:9200/storefront__order_order/_refresh
- response:
- body: {string: '{"_shards":{"total":10,"successful":5,"failed":0}}'}
- headers:
- content-length: ['50']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"settings": {"analysis": {"analyzer": {"edgengram_analyzer": {"type":
- "custom", "tokenizer": "lowercase", "filter": ["asciifolding", "edgengram"]},
- "ngram_analyzer": {"type": "custom", "tokenizer": "lowercase", "filter": ["asciifolding",
- "ngram"]}}, "tokenizer": {"edgengram_tokenizer": {"type": "edgeNGram", "max_gram":
- 15, "min_gram": 2, "side": "front"}, "ngram_tokenizer": {"type": "nGram", "max_gram":
- 15, "min_gram": 3}}, "filter": {"ngram": {"type": "nGram", "max_gram": 15, "min_gram":
- 3}, "edgengram": {"type": "edgeNGram", "max_gram": 15, "min_gram": 1}}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: PUT
- uri: http://search:9200/storefront__userprofile_user
- response:
- body: {string: '{"error":{"root_cause":[{"type":"index_already_exists_exception","reason":"index
- [storefront__userprofile_user/kskhjtSkTtGsOltOEkgl8Q] already exists","index_uuid":"kskhjtSkTtGsOltOEkgl8Q","index":"storefront__userprofile_user"}],"type":"index_already_exists_exception","reason":"index
- [storefront__userprofile_user/kskhjtSkTtGsOltOEkgl8Q] already exists","index_uuid":"kskhjtSkTtGsOltOEkgl8Q","index":"storefront__userprofile_user"},"status":400}'}
- headers:
- content-length: ['447']
- content-type: [application/json; charset=UTF-8]
- status: {code: 400, message: Bad Request}
-- request:
- body: '{"settings": {"analysis": {"filter": {"edgengram": {"min_gram": 1, "type":
- "edgeNGram", "max_gram": 15}, "ngram": {"min_gram": 3, "type": "nGram", "max_gram":
- 15}}, "tokenizer": {"edgengram_tokenizer": {"min_gram": 2, "side": "front",
- "type": "edgeNGram", "max_gram": 15}, "ngram_tokenizer": {"min_gram": 3, "type":
- "nGram", "max_gram": 15}}, "analyzer": {"edgengram_analyzer": {"filter": ["asciifolding",
- "edgengram"], "tokenizer": "lowercase", "type": "custom"}, "ngram_analyzer":
- {"filter": ["asciifolding", "ngram"], "tokenizer": "lowercase", "type": "custom"}}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: PUT
- uri: http://search:9200/storefront__userprofile_user
- response:
- body: {string: '{"error":{"root_cause":[{"type":"index_already_exists_exception","reason":"index
- [storefront__userprofile_user/DIb6VIR2RB-UZBYhQ0OKwA] already exists","index_uuid":"DIb6VIR2RB-UZBYhQ0OKwA","index":"storefront__userprofile_user"}],"type":"index_already_exists_exception","reason":"index
- [storefront__userprofile_user/DIb6VIR2RB-UZBYhQ0OKwA] already exists","index_uuid":"DIb6VIR2RB-UZBYhQ0OKwA","index":"storefront__userprofile_user"},"status":400}'}
- headers:
- content-length: ['447']
- content-type: [application/json; charset=UTF-8]
- status: {code: 400, message: Bad Request}
-- request:
- body: '{"settings": {"analysis": {"analyzer": {"edgengram_analyzer": {"type":
- "custom", "tokenizer": "lowercase", "filter": ["asciifolding", "edgengram"]},
- "ngram_analyzer": {"type": "custom", "tokenizer": "lowercase", "filter": ["asciifolding",
- "ngram"]}}, "tokenizer": {"ngram_tokenizer": {"type": "nGram", "max_gram": 15,
- "min_gram": 3}, "edgengram_tokenizer": {"type": "edgeNGram", "max_gram": 15,
- "side": "front", "min_gram": 2}}, "filter": {"edgengram": {"type": "edgeNGram",
- "max_gram": 15, "min_gram": 1}, "ngram": {"type": "nGram", "max_gram": 15, "min_gram":
- 3}}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: PUT
- uri: http://search:9200/storefront__userprofile_user
- response:
- body: {string: '{"error":{"root_cause":[{"type":"index_already_exists_exception","reason":"index
- [storefront__userprofile_user/DIb6VIR2RB-UZBYhQ0OKwA] already exists","index_uuid":"DIb6VIR2RB-UZBYhQ0OKwA","index":"storefront__userprofile_user"}],"type":"index_already_exists_exception","reason":"index
- [storefront__userprofile_user/DIb6VIR2RB-UZBYhQ0OKwA] already exists","index_uuid":"DIb6VIR2RB-UZBYhQ0OKwA","index":"storefront__userprofile_user"},"status":400}'}
- headers:
- content-length: ['447']
- content-type: [application/json; charset=UTF-8]
- status: {code: 400, message: Bad Request}
-- request:
- body: '{"settings": {"analysis": {"filter": {"ngram": {"min_gram": 3, "type":
- "nGram", "max_gram": 15}, "edgengram": {"min_gram": 1, "type": "edgeNGram",
- "max_gram": 15}}, "analyzer": {"ngram_analyzer": {"filter": ["asciifolding",
- "ngram"], "tokenizer": "lowercase", "type": "custom"}, "edgengram_analyzer":
- {"filter": ["asciifolding", "edgengram"], "tokenizer": "lowercase", "type":
- "custom"}}, "tokenizer": {"edgengram_tokenizer": {"min_gram": 2, "type": "edgeNGram",
- "side": "front", "max_gram": 15}, "ngram_tokenizer": {"min_gram": 3, "type":
- "nGram", "max_gram": 15}}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: PUT
- uri: http://search:9200/storefront__userprofile_user
- response:
- body: {string: '{"error":{"root_cause":[{"type":"index_already_exists_exception","reason":"index
- [storefront__userprofile_user/DIb6VIR2RB-UZBYhQ0OKwA] already exists","index_uuid":"DIb6VIR2RB-UZBYhQ0OKwA","index":"storefront__userprofile_user"}],"type":"index_already_exists_exception","reason":"index
- [storefront__userprofile_user/DIb6VIR2RB-UZBYhQ0OKwA] already exists","index_uuid":"DIb6VIR2RB-UZBYhQ0OKwA","index":"storefront__userprofile_user"},"status":400}'}
- headers:
- content-length: ['447']
- content-type: [application/json; charset=UTF-8]
- status: {code: 400, message: Bad Request}
-- request:
- body: '{"settings": {"analysis": {"tokenizer": {"edgengram_tokenizer": {"side":
- "front", "type": "edgeNGram", "max_gram": 15, "min_gram": 2}, "ngram_tokenizer":
- {"type": "nGram", "max_gram": 15, "min_gram": 3}}, "analyzer": {"edgengram_analyzer":
- {"type": "custom", "tokenizer": "lowercase", "filter": ["asciifolding", "edgengram"]},
- "ngram_analyzer": {"type": "custom", "tokenizer": "lowercase", "filter": ["asciifolding",
- "ngram"]}}, "filter": {"edgengram": {"type": "edgeNGram", "max_gram": 15, "min_gram":
- 1}, "ngram": {"type": "nGram", "max_gram": 15, "min_gram": 3}}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: PUT
- uri: http://search:9200/storefront__userprofile_user
- response:
- body: {string: '{"acknowledged":true,"shards_acknowledged":true}'}
- headers:
- content-length: ['48']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"userprofile_user": {"properties": {"email": {"include_in_all": true,
- "type": "text"}, "_partials": {"include_in_all": false, "type": "text", "analyzer":
- "edgengram_analyzer", "search_analyzer": "standard"}, "content_type": {"include_in_all":
- false, "type": "keyword"}, "pk": {"include_in_all": false, "type": "keyword",
- "store": true}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: PUT
- uri: http://search:9200/storefront__userprofile_user/_mapping/userprofile_user?update_all_types=true
- response:
- body: {string: '{"acknowledged":true}'}
- headers:
- Warning: ['299 Elasticsearch-5.4.3-eed30a8 "field [include_in_all] is deprecated,
- as [_all] is deprecated, and will be disallowed in 6.0, use [copy_to] instead."
- "Mon, 16 Oct 2017 15:04:32 GMT"']
- content-length: ['21']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"settings": {"analysis": {"tokenizer": {"edgengram_tokenizer": {"side":
- "front", "type": "edgeNGram", "max_gram": 15, "min_gram": 2}, "ngram_tokenizer":
- {"type": "nGram", "max_gram": 15, "min_gram": 3}}, "analyzer": {"edgengram_analyzer":
- {"type": "custom", "tokenizer": "lowercase", "filter": ["asciifolding", "edgengram"]},
- "ngram_analyzer": {"type": "custom", "tokenizer": "lowercase", "filter": ["asciifolding",
- "ngram"]}}, "filter": {"edgengram": {"type": "edgeNGram", "max_gram": 15, "min_gram":
- 1}, "ngram": {"type": "nGram", "max_gram": 15, "min_gram": 3}}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: PUT
- uri: http://search:9200/storefront__product_product
- response:
- body: {string: '{"acknowledged":true,"shards_acknowledged":true}'}
- headers:
- content-length: ['48']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"product_product": {"properties": {"name": {"include_in_all": true, "type":
- "text", "analyzer": "edgengram_analyzer", "search_analyzer": "standard"}, "available_on_filter":
- {"include_in_all": false, "type": "date"}, "content_type": {"include_in_all":
- false, "type": "keyword"}, "pk": {"include_in_all": false, "type": "keyword",
- "store": true}, "is_published_filter": {"include_in_all": false, "type": "boolean"},
- "description": {"include_in_all": true, "type": "text"}, "_partials": {"include_in_all":
- false, "type": "text", "analyzer": "edgengram_analyzer", "search_analyzer":
- "standard"}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: PUT
- uri: http://search:9200/storefront__product_product/_mapping/product_product?update_all_types=true
- response:
- body: {string: '{"acknowledged":true}'}
- headers:
- Warning: ['299 Elasticsearch-5.4.3-eed30a8 "field [include_in_all] is deprecated,
- as [_all] is deprecated, and will be disallowed in 6.0, use [copy_to] instead."
- "Mon, 16 Oct 2017 15:04:32 GMT"']
- content-length: ['21']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"index": {"_id": "product_product:1", "_index": "storefront__product_product",
- "_type": "product_product"}}
-
- {"pk": "1", "description": "", "is_published_filter": true, "available_on_filter":
- null, "_partials": ["Test product 1"], "name": "Test product 1", "content_type":
- ["product.Product"]}
-
- {"index": {"_id": "product_product:2", "_index": "storefront__product_product",
- "_type": "product_product"}}
-
- {"pk": "2", "description": "", "is_published_filter": true, "available_on_filter":
- null, "_partials": ["Test product 2"], "name": "Test product 2", "content_type":
- ["product.Product"]}
-
-'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: POST
- uri: http://search:9200/_bulk
- response:
- body: {string: '{"took":127,"errors":false,"items":[{"index":{"_index":"storefront__product_product","_type":"product_product","_id":"product_product:1","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"created":true,"status":201}},{"index":{"_index":"storefront__product_product","_type":"product_product","_id":"product_product:2","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"created":true,"status":201}}]}'}
- headers:
- content-length: ['459']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"settings": {"analysis": {"tokenizer": {"edgengram_tokenizer": {"side":
- "front", "type": "edgeNGram", "max_gram": 15, "min_gram": 2}, "ngram_tokenizer":
- {"type": "nGram", "max_gram": 15, "min_gram": 3}}, "analyzer": {"edgengram_analyzer":
- {"type": "custom", "tokenizer": "lowercase", "filter": ["asciifolding", "edgengram"]},
- "ngram_analyzer": {"type": "custom", "tokenizer": "lowercase", "filter": ["asciifolding",
- "ngram"]}}, "filter": {"edgengram": {"type": "edgeNGram", "max_gram": 15, "min_gram":
- 1}, "ngram": {"type": "nGram", "max_gram": 15, "min_gram": 3}}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: PUT
- uri: http://search:9200/storefront__order_order
- response:
- body: {string: '{"acknowledged":true,"shards_acknowledged":true}'}
- headers:
- content-length: ['48']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"order_order": {"properties": {"_index_shipping_phone": {"include_in_all":
- true, "type": "text"}, "content_type": {"include_in_all": false, "type": "keyword"},
- "pk": {"include_in_all": false, "type": "keyword", "store": true}, "_index_billing_phone":
- {"include_in_all": true, "type": "text"}, "get_user_current_email": {"include_in_all":
- true, "type": "text"}, "_partials": {"include_in_all": false, "type": "text",
- "analyzer": "edgengram_analyzer", "search_analyzer": "standard"}, "id": {"include_in_all":
- true, "type": "integer"}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: PUT
- uri: http://search:9200/storefront__order_order/_mapping/order_order?update_all_types=true
- response:
- body: {string: '{"acknowledged":true}'}
- headers:
- Warning: ['299 Elasticsearch-5.4.3-eed30a8 "field [include_in_all] is deprecated,
- as [_all] is deprecated, and will be disallowed in 6.0, use [copy_to] instead."
- "Mon, 16 Oct 2017 15:04:33 GMT"']
- content-length: ['21']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-version: 1
diff --git a/tests/cassettes/test_search_multiple_words.yaml b/tests/cassettes/test_search_multiple_words.yaml
deleted file mode 100644
index 7c119e84f1..0000000000
--- a/tests/cassettes/test_search_multiple_words.yaml
+++ /dev/null
@@ -1,36 +0,0 @@
-interactions:
-- request:
- body: '{"query": {"bool": {"filter": [{"match": {"content_type": "product.Product"}},
- {"bool": {"must": [{"bool": {"should": [{"range": {"available_on_filter": {"lte":
- "2017-10-17"}}}, {"bool": {"must_not": {"term": {"field": "available_on_filter"}}}}]}},
- {"term": {"is_published_filter": true}}]}}], "must": {"multi_match": {"query":
- "how fortunate the man with none", "fields": ["_all", "_partials"]}}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: GET
- uri: http://search:9200/storefront__product_product/_search?from=0&_source=pk
- response:
- body: {string: '{"took":9,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}'}
- headers:
- content-length: ['122']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"query": {"bool": {"filter": [{"match": {"content_type": "product.Product"}},
- {"bool": {"must": [{"bool": {"should": [{"range": {"available_on_filter": {"lte":
- "2017-10-18"}}}, {"bool": {"must_not": {"term": {"field": "available_on_filter"}}}}]}},
- {"term": {"is_published_filter": true}}]}}], "must": {"multi_match": {"fields":
- ["_all", "_partials"], "query": "how fortunate the man with none"}}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: GET
- uri: http://search:9200/storefront__product_product/_search?_source=pk&from=0
- response:
- body: {string: '{"took":3,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}'}
- headers:
- content-length: ['122']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-version: 1
diff --git a/tests/cassettes/test_search_with_empty_result.yaml b/tests/cassettes/test_search_with_empty_result.yaml
deleted file mode 100644
index 23e82ad9f4..0000000000
--- a/tests/cassettes/test_search_with_empty_result.yaml
+++ /dev/null
@@ -1,36 +0,0 @@
-interactions:
-- request:
- body: '{"query": {"bool": {"filter": [{"match": {"content_type": "product.Product"}},
- {"bool": {"must": [{"bool": {"should": [{"range": {"available_on_filter": {"lte":
- "2017-10-17"}}}, {"bool": {"must_not": {"term": {"field": "available_on_filter"}}}}]}},
- {"term": {"is_published_filter": true}}]}}], "must": {"multi_match": {"fields":
- ["_all", "_partials"], "query": "foo"}}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: GET
- uri: http://search:9200/storefront__product_product/_search?from=0&_source=pk
- response:
- body: {string: '{"took":114,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}'}
- headers:
- content-length: ['124']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-- request:
- body: '{"query": {"bool": {"filter": [{"match": {"content_type": "product.Product"}},
- {"bool": {"must": [{"bool": {"should": [{"range": {"available_on_filter": {"lte":
- "2017-10-18"}}}, {"bool": {"must_not": {"term": {"field": "available_on_filter"}}}}]}},
- {"term": {"is_published_filter": true}}]}}], "must": {"multi_match": {"fields":
- ["_all", "_partials"], "query": "foo"}}}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: GET
- uri: http://search:9200/storefront__product_product/_search?_source=pk&from=0
- response:
- body: {string: '{"took":5,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}'}
- headers:
- content-length: ['122']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-version: 1
diff --git a/tests/cassettes/test_search_with_result.yaml b/tests/cassettes/test_search_with_result.yaml
deleted file mode 100644
index 01ac94bbf9..0000000000
--- a/tests/cassettes/test_search_with_result.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
-interactions:
-- request:
- body: '{"query": {"bool": {"must": {"multi_match": {"query": "Group", "fields":
- ["_all", "_partials"]}}, "filter": [{"match": {"content_type": "product.Product"}},
- {"bool": {"must": [{"bool": {"should": [{"range": {"available_on_filter": {"lte":
- "2017-10-18"}}}, {"bool": {"must_not": {"term": {"field": "available_on_filter"}}}}]}},
- {"term": {"is_published_filter": true}}]}}]}}}'
- headers:
- connection: [keep-alive]
- content-type: [application/json]
- method: GET
- uri: http://search:9200/storefront__product_product/_search?_source=pk&from=0
- response:
- body: {string: '{"took":174,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":4,"max_score":4.4128766,"hits":[{"_index":"storefront__product_product","_type":"product_product","_id":"product_product:3","_score":4.4128766,"_source":{"pk":"3"}},{"_index":"storefront__product_product","_type":"product_product","_id":"product_product:99","_score":4.3689632,"_source":{"pk":"41"}},{"_index":"storefront__product_product","_type":"product_product","_id":"product_product:72","_score":3.2007272,"_source":{"pk":"72"}},{"_index":"storefront__product_product","_type":"product_product","_id":"product_product:92","_score":3.2007272,"_source":{"pk":"59"}}]}}'}
- headers:
- content-length: ['666']
- content-type: [application/json; charset=UTF-8]
- status: {code: 200, message: OK}
-version: 1
diff --git a/tests/test_search.py b/tests/test_search.py
index c48e6dc8e1..887d9a2d65 100644
--- a/tests/test_search.py
+++ b/tests/test_search.py
@@ -1,54 +1,14 @@
from __future__ import unicode_literals
from saleor.product.models import Product
-from django.core.management import call_command
from django.core.urlresolvers import reverse
from decimal import Decimal
import pytest
MATCH_SEARCH_REQUEST = ['method', 'host', 'port', 'path', 'body']
-OLD_BACKEND_FOUND = {41, 59} # same as in recorded data!
NEW_BACKEND_FOUND = {15, 34, 58} # same as in recorded data!
-PRODUCTS_INDEXED = OLD_BACKEND_FOUND | NEW_BACKEND_FOUND
-
-DATE_OF_RECORDING = '2017-10-18' # time freee for old backend
-
-
[email protected](scope='function', autouse=True)
-def recorded_on_date(freezer):
- '''Freeze date during tests to date of recording
-
- Current date is used in search query, please change used constant to new
- current date when re-recording communication with live elasticsearch.
- Leave changed date as new fixed time.
- '''
- freezer.move_to(DATE_OF_RECORDING)
-
-
[email protected](record_mode='once')
-def test_index_products(product_list):
- options = {'backend_name': 'default'}
- call_command('update_index', **options)
-
-
[email protected](record_mode='once', match_on=MATCH_SEARCH_REQUEST)
-def test_search_with_empty_result(db, client):
- WORD = 'foo'
- response = client.get(reverse('search:search'), {'q': WORD})
- assert 0 == len(response.context['results'].object_list)
- assert WORD == response.context['query']
-
-
[email protected](record_mode='once', match_on=MATCH_SEARCH_REQUEST)
-def test_search_multiple_words(db, client):
- ''' Check request format for multiple word phrases '''
- PHRASE = 'how fortunate the man with none'
- client.get(reverse('search:search'), {'q': PHRASE})
-
+PRODUCTS_INDEXED = NEW_BACKEND_FOUND
@pytest.fixture
def indexed_products(product_class, default_category):
@@ -74,16 +34,6 @@ def _extract_pks(object_list):
return [prod.pk for prod, _ in object_list]
[email protected](record_mode='once', match_on=MATCH_SEARCH_REQUEST)
-def test_search_with_result(db, indexed_products, client):
- EXISTING_PHRASE = 'Group'
- response = client.get(reverse('search:search'), {'q': EXISTING_PHRASE})
- found_products = _extract_pks(response.context['results'].object_list)
- assert OLD_BACKEND_FOUND == set(found_products)
- assert EXISTING_PHRASE == response.context['query']
-
-
@pytest.fixture
def new_search_backend():
import saleor.search.forms