Skip to content

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

Create test suite for elasticsearch query creation

Jakub Draganek65f45b52e33e
diff --git a/saleor/search/backends/newelastic.py b/saleor/search/backends/newelastic.py
index 6134e7ba67..51026caea3 100644
--- a/saleor/search/backends/newelastic.py
+++ b/saleor/search/backends/newelastic.py
@@ -1,3 +1,10 @@
+import json
+
+
+def build_es_query():
+ return json.dumps({})
+
+
class SearchBackend(object):
rebuilder_class = None
diff --git a/saleor/search/backends/test_newelastic.py b/saleor/search/backends/test_newelastic.py
new file mode 100644
index 0000000000..f94b886d5b
--- /dev/null
+++ b/saleor/search/backends/test_newelastic.py
@@ -0,0 +1,7 @@
+import json
+from . import newelastic
+
+
+def test_builds_json_query():
+ query = newelastic.build_es_query()
+ json.loads(query)
diff --git a/setup.cfg b/setup.cfg
index 7d04f41fd6..c432405eb2 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -14,7 +14,7 @@ exclude_lines =
return NotImplemented
[tool:pytest]
-testpaths = tests
+testpaths = tests saleor
DJANGO_SETTINGS_MODULE = tests.settings
[flake8]