diff --git a/openlobby/core/documents.py b/openlobby/core/documents.py index 3923f6eada3d24fa47846899c2f07f7a2b665ba9..a5ef151bb69f888ac10ddf675819300e038bd35b 100644 --- a/openlobby/core/documents.py +++ b/openlobby/core/documents.py @@ -5,7 +5,7 @@ import json from .models import Report -report = Index("{}-reports".format(settings.ES_INDEX)) +report = Index(f"{settings.ES_INDEX}-reports") @report.doc_type diff --git a/openlobby/settings.py b/openlobby/settings.py index 7fcb0b24cda95d0b4ba11212bb99a8676bf2d729..1b08799bbdda0094d8579b936c5d35e4ded5c581 100644 --- a/openlobby/settings.py +++ b/openlobby/settings.py @@ -130,7 +130,7 @@ GRAPHENE = {"SCHEMA": "openlobby.schema.schema"} ############################################################################### # Custom settings -# Elasticsearch index with reports +# Elasticsearch index prefix ES_INDEX = os.environ.get("ES_INDEX", "openlobby") # default analyzer for text fields diff --git a/requirements.in b/requirements.in index 14d5b5110c3ac8699f57877f43ca879545e45945..01e78a0c0c973ac7013ca47f0d2bd88613ff2a57 100644 --- a/requirements.in +++ b/requirements.in @@ -1,7 +1,7 @@ Django graphene graphene-django -elasticsearch-dsl>=5.3.0,<6.0.0 +elasticsearch-dsl==6.1.0 django-elasticsearch-dsl django-extensions pytest diff --git a/requirements.txt b/requirements.txt index 2dbe94ae78224439d6d10df2b1f389258e3b1bc4..09775d6cf321be0209a7351c29b65357d1c79485 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,56 +4,55 @@ # # pip-compile --output-file requirements.txt requirements.in # -alabaster==0.7.11 # via oic +alabaster==0.7.12 # via oic aniso8601==3.0.2 # via graphene arrow==0.12.1 asn1crypto==0.24.0 # via cryptography -atomicwrites==1.1.5 # via pytest -attrs==18.1.0 # via pytest +atomicwrites==1.2.1 # via pytest +attrs==18.2.0 # via pytest beaker==1.10.0 # via oic -bleach==2.1.3 -certifi==2018.4.16 # via requests +bleach==3.0.2 +certifi==2018.10.15 # via requests cffi==1.11.5 # via cryptography chardet==3.0.4 # via requests -cryptography==2.2.2 # via pyopenssl +cryptography==2.3.1 # via pyopenssl django-elasticsearch-dsl==0.5.0 -django-extensions==2.0.7 -django==2.0.6 -dsnparse==0.1.11 -elasticsearch-dsl==5.4.0 -elasticsearch==5.5.3 # via elasticsearch-dsl +django-extensions==2.1.3 +django==2.1.2 +dsnparse==0.1.12 +elasticsearch-dsl==6.1.0 +elasticsearch==6.3.1 # via elasticsearch-dsl future==0.16.0 # via oic, pyjwkest -graphene-django==2.0.0 -graphene==2.1.2 -graphql-core==2.0 # via graphene, graphql-relay +graphene-django==2.2.0 +graphene==2.1.3 +graphql-core==2.1 # via graphene, graphene-django, graphql-relay graphql-relay==0.4.5 # via graphene -html5lib==1.0.1 # via bleach idna==2.7 # via cryptography, requests +ipaddress==1.0.22 # via elasticsearch-dsl iso8601==0.1.12 mako==1.0.7 # via oic markupsafe==1.0 # via mako -more-itertools==4.2.0 # via pytest +more-itertools==4.3.0 # via pytest oic==0.14.0 -pluggy==0.6.0 # via pytest -promise==2.1 # via graphene, graphene-django, graphql-core, graphql-relay +pluggy==0.7.1 # via pytest +promise==2.2.1 # via graphene, graphene-django, graphql-core, graphql-relay psycopg2==2.7.5 -py==1.5.3 # via pytest -pycparser==2.18 # via cffi -pycryptodomex==3.6.3 # via oic, pyjwkest +py==1.7.0 # via pytest +pycparser==2.19 # via cffi +pycryptodomex==3.6.6 # via oic, pyjwkest pyjwkest==1.4.0 # via oic pyjwt==1.6.4 pyopenssl==18.0.0 # via oic -pytest-django==3.3.2 +pytest-django==3.4.3 pytest-env==0.6.2 -pytest==3.6.2 +pytest==3.8.2 python-dateutil==2.7.3 # via arrow, elasticsearch-dsl -pytz==2018.4 # via django +pytz==2018.5 # via django requests==2.19.1 # via oic, pyjwkest rx==1.6.1 # via graphql-core singledispatch==3.4.0.3 # via graphene-django -six==1.11.0 # via bleach, cryptography, django-extensions, elasticsearch-dsl, graphene, graphene-django, graphql-core, graphql-relay, html5lib, more-itertools, oic, promise, pyjwkest, pyopenssl, pytest, python-dateutil, singledispatch, snapshottest +six==1.11.0 # via bleach, cryptography, django-extensions, elasticsearch-dsl, graphene, graphene-django, graphql-core, graphql-relay, more-itertools, oic, promise, pyjwkest, pyopenssl, pytest, python-dateutil, singledispatch, snapshottest snapshottest==0.5.0 termcolor==1.1.0 # via snapshottest -typing==3.6.4 # via promise urllib3==1.23 # via elasticsearch, requests -webencodings==0.5.1 # via html5lib +webencodings==0.5.1 # via bleach diff --git a/tests/mutations/snapshots/snap_test_create_report.py b/tests/mutations/snapshots/snap_test_create_report.py index b4abeb0b329c49c5aa6161b549a8f8a18179e392..312d5c1a9bee0d160dabbad5198d2c627e4d2861 100644 --- a/tests/mutations/snapshots/snap_test_create_report.py +++ b/tests/mutations/snapshots/snap_test_create_report.py @@ -13,6 +13,7 @@ snapshots["test_unauthorized 1"] = { { "locations": [{"column": 5, "line": 3}], "message": "User must be logged in to perform this mutation.", + "path": ["createReport"], } ], } diff --git a/tests/mutations/snapshots/snap_test_update_report.py b/tests/mutations/snapshots/snap_test_update_report.py index 64eab571f7052579e2372e3e9451e2602149124e..cbc6339801aa646d2293b3d0919294b811c167ae 100644 --- a/tests/mutations/snapshots/snap_test_update_report.py +++ b/tests/mutations/snapshots/snap_test_update_report.py @@ -13,6 +13,7 @@ snapshots["test_unauthorized 1"] = { { "locations": [{"column": 5, "line": 3}], "message": "User must be logged in to perform this mutation.", + "path": ["updateReport"], } ], } @@ -23,6 +24,7 @@ snapshots["test_not_author 1"] = { { "locations": [{"column": 5, "line": 3}], "message": "Viewer is not the Author of this Report or Report does not exist.", + "path": ["updateReport"], } ], } @@ -33,6 +35,7 @@ snapshots["test_report_does_not_exist 1"] = { { "locations": [{"column": 5, "line": 3}], "message": "Viewer is not the Author of this Report or Report does not exist.", + "path": ["updateReport"], } ], } @@ -43,6 +46,7 @@ snapshots["test_update_published_with_draft 1"] = { { "locations": [{"column": 5, "line": 3}], "message": "You cannot update published Report with draft.", + "path": ["updateReport"], } ], } diff --git a/tests/schema/snapshots/snap_test_authors.py b/tests/schema/snapshots/snap_test_authors.py index fee760ed81195b6f8e693ca922b91ef1eb1a7e38..02bf97df2eff8d3c3d1c371d6b77a6a0534f72ea 100644 --- a/tests/schema/snapshots/snap_test_authors.py +++ b/tests/schema/snapshots/snap_test_authors.py @@ -127,6 +127,7 @@ snapshots["test_last 1"] = { { "locations": [{"column": 9, "line": 3}], "message": 'Pagination "last" works only in combination with "before" argument.', + "path": ["authors"], } ], } diff --git a/tests/schema/snapshots/snap_test_search_reports.py b/tests/schema/snapshots/snap_test_search_reports.py index b0c0e30482c93afca389f9729aa922f341454aaa..694fc552ce38b83d90dd303d3ab26b6bffe363a7 100644 --- a/tests/schema/snapshots/snap_test_search_reports.py +++ b/tests/schema/snapshots/snap_test_search_reports.py @@ -233,6 +233,7 @@ snapshots["test_last 1"] = { { "locations": [{"column": 9, "line": 3}], "message": 'Pagination "last" works only in combination with "before" argument.', + "path": ["searchReports"], } ], }