From 7061085bb4d42f94ff83f46b1a246dba73da8fe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bedna=C5=99=C3=ADk?= <jan.bednarik@gmail.com> Date: Sun, 21 Oct 2018 21:37:54 +0200 Subject: [PATCH] Don't use Black on snapshots and migrations --- pyproject.toml | 13 + .../snapshots/snap_test_create_report.py | 111 +-- tests/mutations/snapshots/snap_test_login.py | 32 +- .../snapshots/snap_test_login_by_shortcut.py | 16 +- .../snapshots/snap_test_update_report.py | 640 ++++++++------- tests/schema/snapshots/snap_test_authors.py | 775 +++++++++--------- .../snapshots/snap_test_login_shortcuts.py | 18 +- tests/schema/snapshots/snap_test_node.py | 131 +-- .../snapshots/snap_test_report_drafts.py | 35 +- .../snapshots/snap_test_search_reports.py | 412 +++++----- tests/schema/snapshots/snap_test_viewer.py | 52 +- tests/snapshots/snap_test_management.py | 165 ---- tests/snapshots/snap_test_middleware.py | 16 +- tests/snapshots/snap_test_models.py | 12 - 14 files changed, 1216 insertions(+), 1212 deletions(-) create mode 100644 pyproject.toml delete mode 100644 tests/snapshots/snap_test_management.py delete mode 100644 tests/snapshots/snap_test_models.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..459459a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,13 @@ +[tool.black] +include = '\.pyi?$' +exclude = ''' +/( + \.git + | \.env + | _build + | build + | dist + | snapshots + | migrations +)/ +''' diff --git a/tests/mutations/snapshots/snap_test_create_report.py b/tests/mutations/snapshots/snap_test_create_report.py index e8f730e..04a0923 100644 --- a/tests/mutations/snapshots/snap_test_create_report.py +++ b/tests/mutations/snapshots/snap_test_create_report.py @@ -7,68 +7,77 @@ from snapshottest import Snapshot snapshots = Snapshot() -snapshots["test_unauthorized 1"] = { - "data": {"createReport": None}, - "errors": [ +snapshots['test_unauthorized 1'] = { + 'data': { + 'createReport': None + }, + 'errors': [ { - "locations": [{"column": 5, "line": 3}], - "message": "User must be logged in to perform this mutation.", - "path": ["createReport"], + 'locations': [ + { + 'column': 5, + 'line': 3 + } + ], + 'message': 'User must be logged in to perform this mutation.', + 'path': [ + 'createReport' + ] } - ], + ] } -snapshots["test_full_report 1"] = { - "data": { - "createReport": { - "report": { - "author": { - "extra": '{"movies": 1}', - "firstName": "Winston", - "id": "QXV0aG9yOjE=", - "lastName": "Wolfe", - "totalReports": 1, +snapshots['test_full_report 1'] = { + 'data': { + 'createReport': { + 'report': { + 'author': { + 'extra': '{"movies": 1}', + 'firstName': 'Winston', + 'id': 'QXV0aG9yOjE=', + 'lastName': 'Wolfe', + 'totalReports': 1 }, - "body": "I visited Tesla factory and talked with Elon Musk.", - "date": "2018-01-01 00:00:00+00:00", - "edited": "__STRIPPED__", - "extra": None, - "id": "__STRIPPED__", - "isDraft": False, - "otherParticipants": "Elon Musk", - "ourParticipants": "me", - "providedBenefit": "nothing", - "published": "__STRIPPED__", - "receivedBenefit": "Tesla Model S", - "title": "Free Tesla", + 'body': 'I visited Tesla factory and talked with Elon Musk.', + 'date': '2018-01-01 00:00:00+00:00', + 'edited': '__STRIPPED__', + 'extra': None, + 'id': '__STRIPPED__', + 'isDraft': False, + 'otherParticipants': 'Elon Musk', + 'ourParticipants': 'me', + 'providedBenefit': 'nothing', + 'published': '__STRIPPED__', + 'receivedBenefit': 'Tesla Model S', + 'title': 'Free Tesla' } } } } -snapshots["test_is_draft 1"] = { - "data": { - "createReport": { - "report": { - "author": { - "extra": '{"movies": 1}', - "firstName": "Winston", - "id": "QXV0aG9yOjE=", - "lastName": "Wolfe", - "totalReports": 0, +snapshots['test_is_draft 1'] = { + 'data': { + 'createReport': { + 'report': { + 'author': { + 'extra': '{"movies": 1}', + 'firstName': 'Winston', + 'id': 'QXV0aG9yOjE=', + 'lastName': 'Wolfe', + 'totalReports': 0 }, - "body": "Niel deGrasse Tyson just visited me...", - "date": "2018-01-03 00:00:00+00:00", - "edited": "__STRIPPED__", - "extra": None, - "id": "__STRIPPED__", - "isDraft": True, - "otherParticipants": "Neil deGrasse Tyson", - "ourParticipants": "myself", - "providedBenefit": "coffee", - "published": "__STRIPPED__", - "receivedBenefit": "touch of the God", - "title": "Visited by old friend", + 'body': 'Niel deGrasse Tyson just visited me...', + 'date': '2018-01-03 00:00:00+00:00', + 'edited': '__STRIPPED__', + 'extra': None, + 'id': '__STRIPPED__', + 'isDraft': True, + 'otherParticipants': 'Neil deGrasse Tyson', + 'ourParticipants': 'myself', + 'providedBenefit': 'coffee', + 'published': '__STRIPPED__', + 'receivedBenefit': 'touch of the God', + 'title': 'Visited by old friend' } } } diff --git a/tests/mutations/snapshots/snap_test_login.py b/tests/mutations/snapshots/snap_test_login.py index 8d93fa0..8a36af7 100644 --- a/tests/mutations/snapshots/snap_test_login.py +++ b/tests/mutations/snapshots/snap_test_login.py @@ -7,18 +7,30 @@ from snapshottest import Snapshot snapshots = Snapshot() -snapshots["test_login__known_openid_client 1"] = { - "userinfo": { - "email": {"essential": True}, - "family_name": {"essential": True}, - "given_name": {"essential": True}, +snapshots['test_login__known_openid_client 1'] = { + 'userinfo': { + 'email': { + 'essential': True + }, + 'family_name': { + 'essential': True + }, + 'given_name': { + 'essential': True + } } } -snapshots["test_login__new_openid_client 1"] = { - "userinfo": { - "email": {"essential": True}, - "family_name": {"essential": True}, - "given_name": {"essential": True}, +snapshots['test_login__new_openid_client 1'] = { + 'userinfo': { + 'email': { + 'essential': True + }, + 'family_name': { + 'essential': True + }, + 'given_name': { + 'essential': True + } } } diff --git a/tests/mutations/snapshots/snap_test_login_by_shortcut.py b/tests/mutations/snapshots/snap_test_login_by_shortcut.py index 4e57bd3..6fe834f 100644 --- a/tests/mutations/snapshots/snap_test_login_by_shortcut.py +++ b/tests/mutations/snapshots/snap_test_login_by_shortcut.py @@ -7,10 +7,16 @@ from snapshottest import Snapshot snapshots = Snapshot() -snapshots["test_login_by_shortcut 1"] = { - "userinfo": { - "email": {"essential": True}, - "family_name": {"essential": True}, - "given_name": {"essential": True}, +snapshots['test_login_by_shortcut 1'] = { + 'userinfo': { + 'email': { + 'essential': True + }, + 'family_name': { + 'essential': True + }, + 'given_name': { + 'essential': True + } } } diff --git a/tests/mutations/snapshots/snap_test_update_report.py b/tests/mutations/snapshots/snap_test_update_report.py index 3c88475..70998a3 100644 --- a/tests/mutations/snapshots/snap_test_update_report.py +++ b/tests/mutations/snapshots/snap_test_update_report.py @@ -7,390 +7,426 @@ from snapshottest import Snapshot snapshots = Snapshot() -snapshots["test_unauthorized 1"] = { - "data": {"updateReport": None}, - "errors": [ +snapshots['test_unauthorized 1'] = { + 'data': { + 'updateReport': None + }, + 'errors': [ { - "locations": [{"column": 5, "line": 3}], - "message": "User must be logged in to perform this mutation.", - "path": ["updateReport"], + 'locations': [ + { + 'column': 5, + 'line': 3 + } + ], + 'message': 'User must be logged in to perform this mutation.', + 'path': [ + 'updateReport' + ] } - ], + ] } -snapshots["test_not_author 1"] = { - "data": {"updateReport": None}, - "errors": [ +snapshots['test_not_author 1'] = { + 'data': { + 'updateReport': None + }, + 'errors': [ { - "locations": [{"column": 5, "line": 3}], - "message": "Viewer is not the Author of this Report or Report does not exist.", - "path": ["updateReport"], + 'locations': [ + { + 'column': 5, + 'line': 3 + } + ], + 'message': 'Viewer is not the Author of this Report or Report does not exist.', + 'path': [ + 'updateReport' + ] } - ], + ] } -snapshots["test_report_does_not_exist 1"] = { - "data": {"updateReport": None}, - "errors": [ +snapshots['test_report_does_not_exist 1'] = { + 'data': { + 'updateReport': None + }, + 'errors': [ { - "locations": [{"column": 5, "line": 3}], - "message": "Viewer is not the Author of this Report or Report does not exist.", - "path": ["updateReport"], + 'locations': [ + { + 'column': 5, + 'line': 3 + } + ], + 'message': 'Viewer is not the Author of this Report or Report does not exist.', + 'path': [ + 'updateReport' + ] } - ], + ] } -snapshots["test_update_published_with_draft 1"] = { - "data": {"updateReport": None}, - "errors": [ +snapshots['test_update_published_with_draft 1'] = { + 'data': { + 'updateReport': None + }, + 'errors': [ { - "locations": [{"column": 5, "line": 3}], - "message": "You cannot update published Report with draft.", - "path": ["updateReport"], + 'locations': [ + { + 'column': 5, + 'line': 3 + } + ], + 'message': 'You cannot update published Report with draft.', + 'path': [ + 'updateReport' + ] } - ], + ] } -snapshots["test_update_draft_with_draft 1"] = { - "data": { - "updateReport": { - "report": { - "author": { - "extra": '{"movies": 1}', - "firstName": "Winston", - "id": "QXV0aG9yOjQy", - "lastName": "Wolfe", - "totalReports": 0, +snapshots['test_update_draft_with_draft 1'] = { + 'data': { + 'updateReport': { + 'report': { + 'author': { + 'extra': '{"movies": 1}', + 'firstName': 'Winston', + 'id': 'QXV0aG9yOjQy', + 'lastName': 'Wolfe', + 'totalReports': 0 }, - "body": "Rewrited", - "date": "2018-03-03 00:00:00+00:00", - "edited": "2018-01-02 05:50:00+00:00", - "extra": None, - "id": "UmVwb3J0OjY2Ng==", - "isDraft": True, - "otherParticipants": "grandchilds", - "ourParticipants": "kids", - "providedBenefit": "water", - "published": "2018-01-02 05:50:00+00:00", - "receivedBenefit": "cake", - "title": "New title", + 'body': 'Rewrited', + 'date': '2018-03-03 00:00:00+00:00', + 'edited': '2018-01-02 05:50:00+00:00', + 'extra': None, + 'id': 'UmVwb3J0OjY2Ng==', + 'isDraft': True, + 'otherParticipants': 'grandchilds', + 'ourParticipants': 'kids', + 'providedBenefit': 'water', + 'published': '2018-01-02 05:50:00+00:00', + 'receivedBenefit': 'cake', + 'title': 'New title' } } } } -snapshots["test_update_draft_with_published 1"] = { - "data": { - "updateReport": { - "report": { - "author": { - "extra": '{"movies": 1}', - "firstName": "Winston", - "id": "QXV0aG9yOjQy", - "lastName": "Wolfe", - "totalReports": 1, +snapshots['test_update_draft_with_published 1'] = { + 'data': { + 'updateReport': { + 'report': { + 'author': { + 'extra': '{"movies": 1}', + 'firstName': 'Winston', + 'id': 'QXV0aG9yOjQy', + 'lastName': 'Wolfe', + 'totalReports': 1 }, - "body": "Rewrited", - "date": "2018-03-03 00:00:00+00:00", - "edited": "2018-01-02 05:50:00+00:00", - "extra": None, - "id": "UmVwb3J0OjY2Ng==", - "isDraft": False, - "otherParticipants": "grandchilds", - "ourParticipants": "kids", - "providedBenefit": "water", - "published": "2018-01-02 05:50:00+00:00", - "receivedBenefit": "cake", - "title": "New title", + 'body': 'Rewrited', + 'date': '2018-03-03 00:00:00+00:00', + 'edited': '2018-01-02 05:50:00+00:00', + 'extra': None, + 'id': 'UmVwb3J0OjY2Ng==', + 'isDraft': False, + 'otherParticipants': 'grandchilds', + 'ourParticipants': 'kids', + 'providedBenefit': 'water', + 'published': '2018-01-02 05:50:00+00:00', + 'receivedBenefit': 'cake', + 'title': 'New title' } } } } -snapshots["test_update_published_with_published 1"] = { - "data": { - "updateReport": { - "report": { - "author": { - "extra": '{"movies": 1}', - "firstName": "Winston", - "id": "QXV0aG9yOjQy", - "lastName": "Wolfe", - "totalReports": 1, +snapshots['test_update_published_with_published 1'] = { + 'data': { + 'updateReport': { + 'report': { + 'author': { + 'extra': '{"movies": 1}', + 'firstName': 'Winston', + 'id': 'QXV0aG9yOjQy', + 'lastName': 'Wolfe', + 'totalReports': 1 }, - "body": "Rewrited", - "date": "2018-03-03 00:00:00+00:00", - "edited": "2018-01-02 05:50:00+00:00", - "extra": None, - "id": "UmVwb3J0OjY2Ng==", - "isDraft": False, - "otherParticipants": "grandchilds", - "ourParticipants": "kids", - "providedBenefit": "water", - "published": "2018-01-02 00:00:00+00:00", - "receivedBenefit": "cake", - "title": "New title", + 'body': 'Rewrited', + 'date': '2018-03-03 00:00:00+00:00', + 'edited': '2018-01-02 05:50:00+00:00', + 'extra': None, + 'id': 'UmVwb3J0OjY2Ng==', + 'isDraft': False, + 'otherParticipants': 'grandchilds', + 'ourParticipants': 'kids', + 'providedBenefit': 'water', + 'published': '2018-01-02 00:00:00+00:00', + 'receivedBenefit': 'cake', + 'title': 'New title' } } } } -snapshots["test_input_sanitization 1"] = { - "data": { - "updateReport": { - "report": { - "author": { - "extra": '{"movies": 1}', - "firstName": "Winston", - "id": "QXV0aG9yOjQy", - "lastName": "Wolfe", - "totalReports": 1, +snapshots['test_input_sanitization 1'] = { + 'data': { + 'updateReport': { + 'report': { + 'author': { + 'extra': '{"movies": 1}', + 'firstName': 'Winston', + 'id': 'QXV0aG9yOjQy', + 'lastName': 'Wolfe', + 'totalReports': 1 }, - "body": "some link in body", - "date": "2018-03-03 00:00:00+00:00", - "edited": "2018-01-02 05:50:00+00:00", - "extra": None, - "id": "UmVwb3J0OjY2Ng==", - "isDraft": False, - "otherParticipants": "you!", - "ourParticipants": "me, myself", - "providedBenefit": "tea", - "published": "2018-01-02 00:00:00+00:00", - "receivedBenefit": "coffee", - "title": "No tags", + 'body': 'some link in body', + 'date': '2018-03-03 00:00:00+00:00', + 'edited': '2018-01-02 05:50:00+00:00', + 'extra': None, + 'id': 'UmVwb3J0OjY2Ng==', + 'isDraft': False, + 'otherParticipants': 'you!', + 'ourParticipants': 'me, myself', + 'providedBenefit': 'tea', + 'published': '2018-01-02 00:00:00+00:00', + 'receivedBenefit': 'coffee', + 'title': 'No tags' } } } } -snapshots["test_update_draft_with_draft__late_edit 1"] = { - "data": { - "updateReport": { - "report": { - "author": { - "extra": '{"movies": 1}', - "firstName": "Winston", - "id": "QXV0aG9yOjQy", - "lastName": "Wolfe", - "totalReports": 0, +snapshots['test_update_draft_with_draft__late_edit 1'] = { + 'data': { + 'updateReport': { + 'report': { + 'author': { + 'extra': '{"movies": 1}', + 'firstName': 'Winston', + 'id': 'QXV0aG9yOjQy', + 'lastName': 'Wolfe', + 'totalReports': 0 }, - "body": "Rewrited", - "date": "2018-03-03 00:00:00+00:00", - "edited": "2018-01-02 06:10:00+00:00", - "extra": None, - "id": "UmVwb3J0OjY2Ng==", - "isDraft": True, - "otherParticipants": "grandchilds", - "ourParticipants": "kids", - "providedBenefit": "water", - "published": "2018-01-02 06:10:00+00:00", - "receivedBenefit": "cake", - "title": "New title", + 'body': 'Rewrited', + 'date': '2018-03-03 00:00:00+00:00', + 'edited': '2018-01-02 06:10:00+00:00', + 'extra': None, + 'id': 'UmVwb3J0OjY2Ng==', + 'isDraft': True, + 'otherParticipants': 'grandchilds', + 'ourParticipants': 'kids', + 'providedBenefit': 'water', + 'published': '2018-01-02 06:10:00+00:00', + 'receivedBenefit': 'cake', + 'title': 'New title' } } } } -snapshots["test_update_draft_with_published__late_edit 1"] = { - "data": { - "updateReport": { - "report": { - "author": { - "extra": '{"movies": 1}', - "firstName": "Winston", - "id": "QXV0aG9yOjQy", - "lastName": "Wolfe", - "totalReports": 1, +snapshots['test_update_draft_with_published__late_edit 1'] = { + 'data': { + 'updateReport': { + 'report': { + 'author': { + 'extra': '{"movies": 1}', + 'firstName': 'Winston', + 'id': 'QXV0aG9yOjQy', + 'lastName': 'Wolfe', + 'totalReports': 1 }, - "body": "Rewrited", - "date": "2018-03-03 00:00:00+00:00", - "edited": "2018-01-02 06:10:00+00:00", - "extra": None, - "id": "UmVwb3J0OjY2Ng==", - "isDraft": False, - "otherParticipants": "grandchilds", - "ourParticipants": "kids", - "providedBenefit": "water", - "published": "2018-01-02 06:10:00+00:00", - "receivedBenefit": "cake", - "title": "New title", + 'body': 'Rewrited', + 'date': '2018-03-03 00:00:00+00:00', + 'edited': '2018-01-02 06:10:00+00:00', + 'extra': None, + 'id': 'UmVwb3J0OjY2Ng==', + 'isDraft': False, + 'otherParticipants': 'grandchilds', + 'ourParticipants': 'kids', + 'providedBenefit': 'water', + 'published': '2018-01-02 06:10:00+00:00', + 'receivedBenefit': 'cake', + 'title': 'New title' } } } } -snapshots["test_update_draft_with_draft 2"] = [ +snapshots['test_update_draft_with_draft 2'] = [ { - "author_id": 42, - "body": "Rewrited", - "date": "2018-03-03T00:00:00+00:00", - "edited": "2018-01-02T05:50:00+00:00", - "extra": None, - "id": 666, - "is_draft": True, - "other_participants": "grandchilds", - "our_participants": "kids", - "provided_benefit": "water", - "published": "2018-01-02T05:50:00+00:00", - "received_benefit": "cake", - "superseded_by_id": None, - "title": "New title", + 'author_id': 42, + 'body': 'Rewrited', + 'date': '2018-03-03T00:00:00+00:00', + 'edited': '2018-01-02T05:50:00+00:00', + 'extra': None, + 'id': 666, + 'is_draft': True, + 'other_participants': 'grandchilds', + 'our_participants': 'kids', + 'provided_benefit': 'water', + 'published': '2018-01-02T05:50:00+00:00', + 'received_benefit': 'cake', + 'superseded_by_id': None, + 'title': 'New title' } ] -snapshots["test_update_draft_with_draft__late_edit 2"] = [ +snapshots['test_update_draft_with_draft__late_edit 2'] = [ { - "author_id": 42, - "body": "Rewrited", - "date": "2018-03-03T00:00:00+00:00", - "edited": "2018-01-02T06:10:00+00:00", - "extra": None, - "id": 666, - "is_draft": True, - "other_participants": "grandchilds", - "our_participants": "kids", - "provided_benefit": "water", - "published": "2018-01-02T06:10:00+00:00", - "received_benefit": "cake", - "superseded_by_id": None, - "title": "New title", + 'author_id': 42, + 'body': 'Rewrited', + 'date': '2018-03-03T00:00:00+00:00', + 'edited': '2018-01-02T06:10:00+00:00', + 'extra': None, + 'id': 666, + 'is_draft': True, + 'other_participants': 'grandchilds', + 'our_participants': 'kids', + 'provided_benefit': 'water', + 'published': '2018-01-02T06:10:00+00:00', + 'received_benefit': 'cake', + 'superseded_by_id': None, + 'title': 'New title' } ] -snapshots["test_update_draft_with_published 2"] = [ +snapshots['test_update_draft_with_published 2'] = [ { - "author_id": 42, - "body": "Rewrited", - "date": "2018-03-03T00:00:00+00:00", - "edited": "2018-01-02T05:50:00+00:00", - "extra": None, - "id": 666, - "is_draft": False, - "other_participants": "grandchilds", - "our_participants": "kids", - "provided_benefit": "water", - "published": "2018-01-02T05:50:00+00:00", - "received_benefit": "cake", - "superseded_by_id": None, - "title": "New title", + 'author_id': 42, + 'body': 'Rewrited', + 'date': '2018-03-03T00:00:00+00:00', + 'edited': '2018-01-02T05:50:00+00:00', + 'extra': None, + 'id': 666, + 'is_draft': False, + 'other_participants': 'grandchilds', + 'our_participants': 'kids', + 'provided_benefit': 'water', + 'published': '2018-01-02T05:50:00+00:00', + 'received_benefit': 'cake', + 'superseded_by_id': None, + 'title': 'New title' } ] -snapshots["test_update_draft_with_published__late_edit 2"] = [ +snapshots['test_update_draft_with_published__late_edit 2'] = [ { - "author_id": 42, - "body": "Rewrited", - "date": "2018-03-03T00:00:00+00:00", - "edited": "2018-01-02T06:10:00+00:00", - "extra": None, - "id": 666, - "is_draft": False, - "other_participants": "grandchilds", - "our_participants": "kids", - "provided_benefit": "water", - "published": "2018-01-02T06:10:00+00:00", - "received_benefit": "cake", - "superseded_by_id": None, - "title": "New title", + 'author_id': 42, + 'body': 'Rewrited', + 'date': '2018-03-03T00:00:00+00:00', + 'edited': '2018-01-02T06:10:00+00:00', + 'extra': None, + 'id': 666, + 'is_draft': False, + 'other_participants': 'grandchilds', + 'our_participants': 'kids', + 'provided_benefit': 'water', + 'published': '2018-01-02T06:10:00+00:00', + 'received_benefit': 'cake', + 'superseded_by_id': None, + 'title': 'New title' } ] -snapshots["test_update_published_with_published 2"] = [ +snapshots['test_update_published_with_published 2'] = [ { - "author_id": 42, - "body": "Rewrited", - "date": "2018-03-03T00:00:00+00:00", - "edited": "2018-01-02T05:50:00+00:00", - "extra": None, - "id": 666, - "is_draft": False, - "other_participants": "grandchilds", - "our_participants": "kids", - "provided_benefit": "water", - "published": "2018-01-02T00:00:00+00:00", - "received_benefit": "cake", - "superseded_by_id": None, - "title": "New title", + 'author_id': 42, + 'body': 'Rewrited', + 'date': '2018-03-03T00:00:00+00:00', + 'edited': '2018-01-02T05:50:00+00:00', + 'extra': None, + 'id': 666, + 'is_draft': False, + 'other_participants': 'grandchilds', + 'our_participants': 'kids', + 'provided_benefit': 'water', + 'published': '2018-01-02T00:00:00+00:00', + 'received_benefit': 'cake', + 'superseded_by_id': None, + 'title': 'New title' } ] -snapshots["test_update_published_with_published__late_edit 1"] = { - "data": { - "updateReport": { - "report": { - "author": { - "extra": '{"movies": 1}', - "firstName": "Winston", - "id": "QXV0aG9yOjQy", - "lastName": "Wolfe", - "totalReports": 1, +snapshots['test_update_published_with_published__late_edit 1'] = { + 'data': { + 'updateReport': { + 'report': { + 'author': { + 'extra': '{"movies": 1}', + 'firstName': 'Winston', + 'id': 'QXV0aG9yOjQy', + 'lastName': 'Wolfe', + 'totalReports': 1 }, - "body": "Rewrited", - "date": "2018-03-03 00:00:00+00:00", - "edited": "2018-01-02 06:10:00+00:00", - "extra": None, - "id": "UmVwb3J0OjY2Ng==", - "isDraft": False, - "otherParticipants": "grandchilds", - "ourParticipants": "kids", - "providedBenefit": "water", - "published": "2018-01-02 00:00:00+00:00", - "receivedBenefit": "cake", - "title": "New title", + 'body': 'Rewrited', + 'date': '2018-03-03 00:00:00+00:00', + 'edited': '2018-01-02 06:10:00+00:00', + 'extra': None, + 'id': 'UmVwb3J0OjY2Ng==', + 'isDraft': False, + 'otherParticipants': 'grandchilds', + 'ourParticipants': 'kids', + 'providedBenefit': 'water', + 'published': '2018-01-02 00:00:00+00:00', + 'receivedBenefit': 'cake', + 'title': 'New title' } } } } -snapshots["test_update_published_with_published__late_edit 2"] = { - "author_id": 42, - "body": "Rewrited", - "date": "2018-03-03T00:00:00+00:00", - "edited": "2018-01-02T06:10:00+00:00", - "extra": None, - "id": 666, - "is_draft": False, - "other_participants": "grandchilds", - "our_participants": "kids", - "provided_benefit": "water", - "published": "2018-01-02T00:00:00+00:00", - "received_benefit": "cake", - "superseded_by_id": None, - "title": "New title", +snapshots['test_update_published_with_published__late_edit 2'] = { + 'author_id': 42, + 'body': 'Rewrited', + 'date': '2018-03-03T00:00:00+00:00', + 'edited': '2018-01-02T06:10:00+00:00', + 'extra': None, + 'id': 666, + 'is_draft': False, + 'other_participants': 'grandchilds', + 'our_participants': 'kids', + 'provided_benefit': 'water', + 'published': '2018-01-02T00:00:00+00:00', + 'received_benefit': 'cake', + 'superseded_by_id': None, + 'title': 'New title' } -snapshots["test_input_sanitization 2"] = [ +snapshots['test_input_sanitization 2'] = [ { - "author_id": 42, - "body": "some link in body", - "date": "2018-03-03T00:00:00+00:00", - "edited": "2018-01-02T05:50:00+00:00", - "extra": None, - "id": 666, - "is_draft": False, - "other_participants": "you!", - "our_participants": "me, myself", - "provided_benefit": "tea", - "published": "2018-01-02T00:00:00+00:00", - "received_benefit": "coffee", - "superseded_by_id": None, - "title": "No tags", + 'author_id': 42, + 'body': 'some link in body', + 'date': '2018-03-03T00:00:00+00:00', + 'edited': '2018-01-02T05:50:00+00:00', + 'extra': None, + 'id': 666, + 'is_draft': False, + 'other_participants': 'you!', + 'our_participants': 'me, myself', + 'provided_benefit': 'tea', + 'published': '2018-01-02T00:00:00+00:00', + 'received_benefit': 'coffee', + 'superseded_by_id': None, + 'title': 'No tags' } ] -snapshots["test_update_published_with_published__late_edit 3"] = { - "author_id": 42, - "body": "Previous body.", - "date": "2018-01-01T00:00:00+00:00", - "edited": "2018-01-02T05:00:00+00:00", - "extra": None, - "id": "__STRIPPED__", - "is_draft": False, - "other_participants": "grandma", - "our_participants": "grandpa", - "provided_benefit": "old tea", - "published": "2018-01-02T00:00:00+00:00", - "received_benefit": "old coffee", - "superseded_by_id": 666, - "title": "Original", +snapshots['test_update_published_with_published__late_edit 3'] = { + 'author_id': 42, + 'body': 'Previous body.', + 'date': '2018-01-01T00:00:00+00:00', + 'edited': '2018-01-02T05:00:00+00:00', + 'extra': None, + 'id': '__STRIPPED__', + 'is_draft': False, + 'other_participants': 'grandma', + 'our_participants': 'grandpa', + 'provided_benefit': 'old tea', + 'published': '2018-01-02T00:00:00+00:00', + 'received_benefit': 'old coffee', + 'superseded_by_id': 666, + 'title': 'Original' } diff --git a/tests/schema/snapshots/snap_test_authors.py b/tests/schema/snapshots/snap_test_authors.py index 919b60d..83db2ae 100644 --- a/tests/schema/snapshots/snap_test_authors.py +++ b/tests/schema/snapshots/snap_test_authors.py @@ -7,500 +7,513 @@ from snapshottest import Snapshot snapshots = Snapshot() -snapshots["test_all 1"] = { - "data": { - "authors": { - "edges": [ +snapshots['test_all 1'] = { + 'data': { + 'authors': { + 'edges': [ { - "cursor": "MQ==", - "node": { - "extra": None, - "firstName": "Shaun", - "hasCollidingName": False, - "id": "QXV0aG9yOjI=", - "lastName": "Sheep", - "totalReports": 1, - }, + 'cursor': 'MQ==', + 'node': { + 'extra': None, + 'firstName': 'Shaun', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjI=', + 'lastName': 'Sheep', + 'totalReports': 1 + } }, { - "cursor": "Mg==", - "node": { - "extra": None, - "firstName": "Spongebob", - "hasCollidingName": False, - "id": "QXV0aG9yOjM=", - "lastName": "Squarepants", - "totalReports": 0, - }, + 'cursor': 'Mg==', + 'node': { + 'extra': None, + 'firstName': 'Spongebob', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjM=', + 'lastName': 'Squarepants', + 'totalReports': 0 + } }, { - "cursor": "Mw==", - "node": { - "extra": '{"movies": 1}', - "firstName": "Winston", - "hasCollidingName": False, - "id": "QXV0aG9yOjE=", - "lastName": "Wolfe", - "totalReports": 2, - }, - }, + 'cursor': 'Mw==', + 'node': { + 'extra': '{"movies": 1}', + 'firstName': 'Winston', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjE=', + 'lastName': 'Wolfe', + 'totalReports': 2 + } + } ], - "pageInfo": { - "endCursor": "Mw==", - "hasNextPage": False, - "hasPreviousPage": False, - "startCursor": "MQ==", + 'pageInfo': { + 'endCursor': 'Mw==', + 'hasNextPage': False, + 'hasPreviousPage': False, + 'startCursor': 'MQ==' }, - "totalCount": 3, + 'totalCount': 3 } } } -snapshots["test_first 1"] = { - "data": { - "authors": { - "edges": [ +snapshots['test_first 1'] = { + 'data': { + 'authors': { + 'edges': [ { - "cursor": "MQ==", - "node": { - "extra": None, - "firstName": "Shaun", - "hasCollidingName": False, - "id": "QXV0aG9yOjI=", - "lastName": "Sheep", - "totalReports": 1, - }, + 'cursor': 'MQ==', + 'node': { + 'extra': None, + 'firstName': 'Shaun', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjI=', + 'lastName': 'Sheep', + 'totalReports': 1 + } }, { - "cursor": "Mg==", - "node": { - "extra": None, - "firstName": "Spongebob", - "hasCollidingName": False, - "id": "QXV0aG9yOjM=", - "lastName": "Squarepants", - "totalReports": 0, - }, - }, + 'cursor': 'Mg==', + 'node': { + 'extra': None, + 'firstName': 'Spongebob', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjM=', + 'lastName': 'Squarepants', + 'totalReports': 0 + } + } ], - "pageInfo": { - "endCursor": "Mg==", - "hasNextPage": True, - "hasPreviousPage": False, - "startCursor": "MQ==", + 'pageInfo': { + 'endCursor': 'Mg==', + 'hasNextPage': True, + 'hasPreviousPage': False, + 'startCursor': 'MQ==' }, - "totalCount": 3, + 'totalCount': 3 } } } -snapshots["test_first_after 1"] = { - "data": { - "authors": { - "edges": [ +snapshots['test_first_after 1'] = { + 'data': { + 'authors': { + 'edges': [ { - "cursor": "Mg==", - "node": { - "extra": None, - "firstName": "Spongebob", - "hasCollidingName": False, - "id": "QXV0aG9yOjM=", - "lastName": "Squarepants", - "totalReports": 0, - }, + 'cursor': 'Mg==', + 'node': { + 'extra': None, + 'firstName': 'Spongebob', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjM=', + 'lastName': 'Squarepants', + 'totalReports': 0 + } } ], - "pageInfo": { - "endCursor": "Mg==", - "hasNextPage": True, - "hasPreviousPage": True, - "startCursor": "Mg==", + 'pageInfo': { + 'endCursor': 'Mg==', + 'hasNextPage': True, + 'hasPreviousPage': True, + 'startCursor': 'Mg==' }, - "totalCount": 3, + 'totalCount': 3 } } } -snapshots["test_last 1"] = { - "data": {"authors": None}, - "errors": [ +snapshots['test_last 1'] = { + 'data': { + 'authors': None + }, + 'errors': [ { - "locations": [{"column": 9, "line": 3}], - "message": 'Pagination "last" works only in combination with "before" argument.', - "path": ["authors"], + 'locations': [ + { + 'column': 9, + 'line': 3 + } + ], + 'message': 'Pagination "last" works only in combination with "before" argument.', + 'path': [ + 'authors' + ] } - ], + ] } -snapshots["test_last_before 1"] = { - "data": { - "authors": { - "edges": [ +snapshots['test_last_before 1'] = { + 'data': { + 'authors': { + 'edges': [ { - "cursor": "Mg==", - "node": { - "extra": None, - "firstName": "Spongebob", - "hasCollidingName": False, - "id": "QXV0aG9yOjM=", - "lastName": "Squarepants", - "totalReports": 0, - }, + 'cursor': 'Mg==', + 'node': { + 'extra': None, + 'firstName': 'Spongebob', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjM=', + 'lastName': 'Squarepants', + 'totalReports': 0 + } } ], - "pageInfo": { - "endCursor": "Mg==", - "hasNextPage": True, - "hasPreviousPage": True, - "startCursor": "Mg==", + 'pageInfo': { + 'endCursor': 'Mg==', + 'hasNextPage': True, + 'hasPreviousPage': True, + 'startCursor': 'Mg==' }, - "totalCount": 3, + 'totalCount': 3 } } } -snapshots["test_with_reports 1"] = { - "data": { - "authors": { - "edges": [ +snapshots['test_with_reports 1'] = { + 'data': { + 'authors': { + 'edges': [ { - "node": { - "extra": None, - "firstName": "Shaun", - "hasCollidingName": False, - "id": "QXV0aG9yOjI=", - "lastName": "Sheep", - "reports": { - "edges": [ + 'node': { + 'extra': None, + 'firstName': 'Shaun', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjI=', + 'lastName': 'Sheep', + 'reports': { + 'edges': [ { - "cursor": "MQ==", - "node": { - "body": "Another long story.", - "date": "2018-01-03 00:00:00+00:00", - "edited": "2018-01-04 05:00:00+00:00", - "extra": '{"rings": 1}', - "id": "UmVwb3J0OjI=", - "isDraft": False, - "otherParticipants": "Saruman, Sauron", - "ourParticipants": "Frodo, Gimli, Legolas", - "providedBenefit": "", - "published": "2018-01-04 00:00:00+00:00", - "receivedBenefit": "Mithrill Jacket", - "title": "The Two Towers", - }, + 'cursor': 'MQ==', + 'node': { + 'body': 'Another long story.', + 'date': '2018-01-03 00:00:00+00:00', + 'edited': '2018-01-04 05:00:00+00:00', + 'extra': '{"rings": 1}', + 'id': 'UmVwb3J0OjI=', + 'isDraft': False, + 'otherParticipants': 'Saruman, Sauron', + 'ourParticipants': 'Frodo, Gimli, Legolas', + 'providedBenefit': '', + 'published': '2018-01-04 00:00:00+00:00', + 'receivedBenefit': 'Mithrill Jacket', + 'title': 'The Two Towers' + } } ], - "totalCount": 1, + 'totalCount': 1 }, - "totalReports": 1, + 'totalReports': 1 } }, { - "node": { - "extra": None, - "firstName": "Spongebob", - "hasCollidingName": False, - "id": "QXV0aG9yOjM=", - "lastName": "Squarepants", - "reports": {"edges": [], "totalCount": 0}, - "totalReports": 0, + 'node': { + 'extra': None, + 'firstName': 'Spongebob', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjM=', + 'lastName': 'Squarepants', + 'reports': { + 'edges': [ + ], + 'totalCount': 0 + }, + 'totalReports': 0 } }, { - "node": { - "extra": '{"movies": 1}', - "firstName": "Winston", - "hasCollidingName": False, - "id": "QXV0aG9yOjE=", - "lastName": "Wolfe", - "reports": { - "edges": [ + 'node': { + 'extra': '{"movies": 1}', + 'firstName': 'Winston', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjE=', + 'lastName': 'Wolfe', + 'reports': { + 'edges': [ { - "cursor": "MQ==", - "node": { - "body": "Aragorn is the King. And we have lost the Ring.", - "date": "2018-01-05 00:00:00+00:00", - "edited": "2018-01-06 07:00:00+00:00", - "extra": None, - "id": "UmVwb3J0OjM=", - "isDraft": False, - "otherParticipants": "Sauron", - "ourParticipants": "Aragorn", - "providedBenefit": "The Ring", - "published": "2018-01-06 00:00:00+00:00", - "receivedBenefit": "", - "title": "The Return of the King", - }, + 'cursor': 'MQ==', + 'node': { + 'body': 'Aragorn is the King. And we have lost the Ring.', + 'date': '2018-01-05 00:00:00+00:00', + 'edited': '2018-01-06 07:00:00+00:00', + 'extra': None, + 'id': 'UmVwb3J0OjM=', + 'isDraft': False, + 'otherParticipants': 'Sauron', + 'ourParticipants': 'Aragorn', + 'providedBenefit': 'The Ring', + 'published': '2018-01-06 00:00:00+00:00', + 'receivedBenefit': '', + 'title': 'The Return of the King' + } }, { - "cursor": "Mg==", - "node": { - "body": "Long story short: we got the Ring!", - "date": "2018-01-01 00:00:00+00:00", - "edited": "2018-01-02 03:00:00+00:00", - "extra": None, - "id": "UmVwb3J0OjE=", - "isDraft": False, - "otherParticipants": "Saruman", - "ourParticipants": "Frodo, Gandalf", - "providedBenefit": "", - "published": "2018-01-02 00:00:00+00:00", - "receivedBenefit": "The Ring", - "title": "The Fellowship of the Ring", - }, - }, + 'cursor': 'Mg==', + 'node': { + 'body': 'Long story short: we got the Ring!', + 'date': '2018-01-01 00:00:00+00:00', + 'edited': '2018-01-02 03:00:00+00:00', + 'extra': None, + 'id': 'UmVwb3J0OjE=', + 'isDraft': False, + 'otherParticipants': 'Saruman', + 'ourParticipants': 'Frodo, Gandalf', + 'providedBenefit': '', + 'published': '2018-01-02 00:00:00+00:00', + 'receivedBenefit': 'The Ring', + 'title': 'The Fellowship of the Ring' + } + } ], - "totalCount": 2, + 'totalCount': 2 }, - "totalReports": 2, + 'totalReports': 2 } - }, + } ] } } } -snapshots["test_sort_by_last_name 1"] = { - "data": { - "authors": { - "edges": [ +snapshots['test_sort_by_last_name 1'] = { + 'data': { + 'authors': { + 'edges': [ { - "cursor": "MQ==", - "node": { - "extra": None, - "firstName": "Shaun", - "hasCollidingName": False, - "id": "QXV0aG9yOjI=", - "lastName": "Sheep", - "totalReports": 1, - }, + 'cursor': 'MQ==', + 'node': { + 'extra': None, + 'firstName': 'Shaun', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjI=', + 'lastName': 'Sheep', + 'totalReports': 1 + } }, { - "cursor": "Mg==", - "node": { - "extra": None, - "firstName": "Spongebob", - "hasCollidingName": False, - "id": "QXV0aG9yOjM=", - "lastName": "Squarepants", - "totalReports": 0, - }, + 'cursor': 'Mg==', + 'node': { + 'extra': None, + 'firstName': 'Spongebob', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjM=', + 'lastName': 'Squarepants', + 'totalReports': 0 + } }, { - "cursor": "Mw==", - "node": { - "extra": '{"movies": 1}', - "firstName": "Winston", - "hasCollidingName": False, - "id": "QXV0aG9yOjE=", - "lastName": "Wolfe", - "totalReports": 2, - }, - }, + 'cursor': 'Mw==', + 'node': { + 'extra': '{"movies": 1}', + 'firstName': 'Winston', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjE=', + 'lastName': 'Wolfe', + 'totalReports': 2 + } + } ], - "pageInfo": { - "endCursor": "Mw==", - "hasNextPage": False, - "hasPreviousPage": False, - "startCursor": "MQ==", + 'pageInfo': { + 'endCursor': 'Mw==', + 'hasNextPage': False, + 'hasPreviousPage': False, + 'startCursor': 'MQ==' }, - "totalCount": 3, + 'totalCount': 3 } } } -snapshots["test_sort_by_last_name_reversed 1"] = { - "data": { - "authors": { - "edges": [ +snapshots['test_sort_by_last_name_reversed 1'] = { + 'data': { + 'authors': { + 'edges': [ { - "cursor": "MQ==", - "node": { - "extra": '{"movies": 1}', - "firstName": "Winston", - "hasCollidingName": False, - "id": "QXV0aG9yOjE=", - "lastName": "Wolfe", - "totalReports": 2, - }, + 'cursor': 'MQ==', + 'node': { + 'extra': '{"movies": 1}', + 'firstName': 'Winston', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjE=', + 'lastName': 'Wolfe', + 'totalReports': 2 + } }, { - "cursor": "Mg==", - "node": { - "extra": None, - "firstName": "Spongebob", - "hasCollidingName": False, - "id": "QXV0aG9yOjM=", - "lastName": "Squarepants", - "totalReports": 0, - }, + 'cursor': 'Mg==', + 'node': { + 'extra': None, + 'firstName': 'Spongebob', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjM=', + 'lastName': 'Squarepants', + 'totalReports': 0 + } }, { - "cursor": "Mw==", - "node": { - "extra": None, - "firstName": "Shaun", - "hasCollidingName": False, - "id": "QXV0aG9yOjI=", - "lastName": "Sheep", - "totalReports": 1, - }, - }, + 'cursor': 'Mw==', + 'node': { + 'extra': None, + 'firstName': 'Shaun', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjI=', + 'lastName': 'Sheep', + 'totalReports': 1 + } + } ], - "pageInfo": { - "endCursor": "Mw==", - "hasNextPage": False, - "hasPreviousPage": False, - "startCursor": "MQ==", + 'pageInfo': { + 'endCursor': 'Mw==', + 'hasNextPage': False, + 'hasPreviousPage': False, + 'startCursor': 'MQ==' }, - "totalCount": 3, + 'totalCount': 3 } } } -snapshots["test_sort_by_total_reports 1"] = { - "data": { - "authors": { - "edges": [ +snapshots['test_sort_by_total_reports 1'] = { + 'data': { + 'authors': { + 'edges': [ { - "cursor": "MQ==", - "node": { - "extra": '{"movies": 1}', - "firstName": "Winston", - "hasCollidingName": False, - "id": "QXV0aG9yOjE=", - "lastName": "Wolfe", - "totalReports": 2, - }, + 'cursor': 'MQ==', + 'node': { + 'extra': '{"movies": 1}', + 'firstName': 'Winston', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjE=', + 'lastName': 'Wolfe', + 'totalReports': 2 + } }, { - "cursor": "Mg==", - "node": { - "extra": None, - "firstName": "Shaun", - "hasCollidingName": False, - "id": "QXV0aG9yOjI=", - "lastName": "Sheep", - "totalReports": 1, - }, + 'cursor': 'Mg==', + 'node': { + 'extra': None, + 'firstName': 'Shaun', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjI=', + 'lastName': 'Sheep', + 'totalReports': 1 + } }, { - "cursor": "Mw==", - "node": { - "extra": None, - "firstName": "Spongebob", - "hasCollidingName": False, - "id": "QXV0aG9yOjM=", - "lastName": "Squarepants", - "totalReports": 0, - }, - }, + 'cursor': 'Mw==', + 'node': { + 'extra': None, + 'firstName': 'Spongebob', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjM=', + 'lastName': 'Squarepants', + 'totalReports': 0 + } + } ], - "pageInfo": { - "endCursor": "Mw==", - "hasNextPage": False, - "hasPreviousPage": False, - "startCursor": "MQ==", + 'pageInfo': { + 'endCursor': 'Mw==', + 'hasNextPage': False, + 'hasPreviousPage': False, + 'startCursor': 'MQ==' }, - "totalCount": 3, + 'totalCount': 3 } } } -snapshots["test_sort_by_total_reports_reversed 1"] = { - "data": { - "authors": { - "edges": [ +snapshots['test_sort_by_total_reports_reversed 1'] = { + 'data': { + 'authors': { + 'edges': [ { - "cursor": "MQ==", - "node": { - "extra": None, - "firstName": "Spongebob", - "hasCollidingName": False, - "id": "QXV0aG9yOjM=", - "lastName": "Squarepants", - "totalReports": 0, - }, + 'cursor': 'MQ==', + 'node': { + 'extra': None, + 'firstName': 'Spongebob', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjM=', + 'lastName': 'Squarepants', + 'totalReports': 0 + } }, { - "cursor": "Mg==", - "node": { - "extra": None, - "firstName": "Shaun", - "hasCollidingName": False, - "id": "QXV0aG9yOjI=", - "lastName": "Sheep", - "totalReports": 1, - }, + 'cursor': 'Mg==', + 'node': { + 'extra': None, + 'firstName': 'Shaun', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjI=', + 'lastName': 'Sheep', + 'totalReports': 1 + } }, { - "cursor": "Mw==", - "node": { - "extra": '{"movies": 1}', - "firstName": "Winston", - "hasCollidingName": False, - "id": "QXV0aG9yOjE=", - "lastName": "Wolfe", - "totalReports": 2, - }, - }, + 'cursor': 'Mw==', + 'node': { + 'extra': '{"movies": 1}', + 'firstName': 'Winston', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjE=', + 'lastName': 'Wolfe', + 'totalReports': 2 + } + } ], - "pageInfo": { - "endCursor": "Mw==", - "hasNextPage": False, - "hasPreviousPage": False, - "startCursor": "MQ==", + 'pageInfo': { + 'endCursor': 'Mw==', + 'hasNextPage': False, + 'hasPreviousPage': False, + 'startCursor': 'MQ==' }, - "totalCount": 3, + 'totalCount': 3 } } } -snapshots["test_sort_by_default_reversed 1"] = { - "data": { - "authors": { - "edges": [ +snapshots['test_sort_by_default_reversed 1'] = { + 'data': { + 'authors': { + 'edges': [ { - "cursor": "MQ==", - "node": { - "extra": '{"movies": 1}', - "firstName": "Winston", - "hasCollidingName": False, - "id": "QXV0aG9yOjE=", - "lastName": "Wolfe", - "totalReports": 2, - }, + 'cursor': 'MQ==', + 'node': { + 'extra': '{"movies": 1}', + 'firstName': 'Winston', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjE=', + 'lastName': 'Wolfe', + 'totalReports': 2 + } }, { - "cursor": "Mg==", - "node": { - "extra": None, - "firstName": "Spongebob", - "hasCollidingName": False, - "id": "QXV0aG9yOjM=", - "lastName": "Squarepants", - "totalReports": 0, - }, + 'cursor': 'Mg==', + 'node': { + 'extra': None, + 'firstName': 'Spongebob', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjM=', + 'lastName': 'Squarepants', + 'totalReports': 0 + } }, { - "cursor": "Mw==", - "node": { - "extra": None, - "firstName": "Shaun", - "hasCollidingName": False, - "id": "QXV0aG9yOjI=", - "lastName": "Sheep", - "totalReports": 1, - }, - }, + 'cursor': 'Mw==', + 'node': { + 'extra': None, + 'firstName': 'Shaun', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjI=', + 'lastName': 'Sheep', + 'totalReports': 1 + } + } ], - "pageInfo": { - "endCursor": "Mw==", - "hasNextPage": False, - "hasPreviousPage": False, - "startCursor": "MQ==", + 'pageInfo': { + 'endCursor': 'Mw==', + 'hasNextPage': False, + 'hasPreviousPage': False, + 'startCursor': 'MQ==' }, - "totalCount": 3, + 'totalCount': 3 } } } diff --git a/tests/schema/snapshots/snap_test_login_shortcuts.py b/tests/schema/snapshots/snap_test_login_shortcuts.py index 252a4f8..45cc81f 100644 --- a/tests/schema/snapshots/snap_test_login_shortcuts.py +++ b/tests/schema/snapshots/snap_test_login_shortcuts.py @@ -7,8 +7,20 @@ from snapshottest import Snapshot snapshots = Snapshot() -snapshots["test_returns_only_shortcuts 1"] = { - "data": {"loginShortcuts": [{"id": "TG9naW5TaG9ydGN1dDoyMA==", "name": "bar"}]} +snapshots['test_returns_only_shortcuts 1'] = { + 'data': { + 'loginShortcuts': [ + { + 'id': 'TG9naW5TaG9ydGN1dDoyMA==', + 'name': 'bar' + } + ] + } } -snapshots["test_none 1"] = {"data": {"loginShortcuts": []}} +snapshots['test_none 1'] = { + 'data': { + 'loginShortcuts': [ + ] + } +} diff --git a/tests/schema/snapshots/snap_test_node.py b/tests/schema/snapshots/snap_test_node.py index de5bb83..161f827 100644 --- a/tests/schema/snapshots/snap_test_node.py +++ b/tests/schema/snapshots/snap_test_node.py @@ -7,76 +7,105 @@ from snapshottest import Snapshot snapshots = Snapshot() -snapshots["test_login_shortcut 1"] = { - "data": {"node": {"id": "TG9naW5TaG9ydGN1dDoxMA==", "name": "foo"}} +snapshots['test_login_shortcut 1'] = { + 'data': { + 'node': { + 'id': 'TG9naW5TaG9ydGN1dDoxMA==', + 'name': 'foo' + } + } } -snapshots["test_author 1"] = { - "data": { - "node": { - "extra": '{"movies": 1}', - "firstName": "Winston", - "hasCollidingName": False, - "id": "QXV0aG9yOjE=", - "lastName": "Wolfe", - "totalReports": 2, +snapshots['test_author 1'] = { + 'data': { + 'node': { + 'extra': '{"movies": 1}', + 'firstName': 'Winston', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjE=', + 'lastName': 'Wolfe', + 'totalReports': 2 } } } -snapshots["test_author__returns_only_if_is_author 1"] = {"data": {"node": None}} +snapshots['test_author__returns_only_if_is_author 1'] = { + 'data': { + 'node': None + } +} -snapshots["test_report 1"] = { - "data": { - "node": { - "author": { - "extra": '{"movies": 1}', - "firstName": "Winston", - "hasCollidingName": False, - "id": "QXV0aG9yOjE=", - "lastName": "Wolfe", - "totalReports": 2, +snapshots['test_report 1'] = { + 'data': { + 'node': { + 'author': { + 'extra': '{"movies": 1}', + 'firstName': 'Winston', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjE=', + 'lastName': 'Wolfe', + 'totalReports': 2 }, - "body": "Long story short: we got the Ring!", - "date": "2018-01-01 00:00:00+00:00", - "edited": "2018-01-02 03:00:00+00:00", - "extra": None, - "id": "UmVwb3J0OjE=", - "isDraft": False, - "otherParticipants": "Saruman", - "ourParticipants": "Frodo, Gandalf", - "providedBenefit": "", - "published": "2018-01-02 00:00:00+00:00", - "receivedBenefit": "The Ring", - "title": "The Fellowship of the Ring", + 'body': 'Long story short: we got the Ring!', + 'date': '2018-01-01 00:00:00+00:00', + 'edited': '2018-01-02 03:00:00+00:00', + 'extra': None, + 'id': 'UmVwb3J0OjE=', + 'isDraft': False, + 'otherParticipants': 'Saruman', + 'ourParticipants': 'Frodo, Gandalf', + 'providedBenefit': '', + 'published': '2018-01-02 00:00:00+00:00', + 'receivedBenefit': 'The Ring', + 'title': 'The Fellowship of the Ring' } } } -snapshots["test_user__unauthorized 1"] = {"data": {"node": None}} +snapshots['test_user__unauthorized 1'] = { + 'data': { + 'node': None + } +} -snapshots["test_user__not_a_viewer 1"] = {"data": {"node": None}} +snapshots['test_user__not_a_viewer 1'] = { + 'data': { + 'node': None + } +} -snapshots["test_user 1"] = { - "data": { - "node": { - "extra": '{"e": "mc2"}', - "firstName": "Albert", - "hasCollidingName": False, - "id": "VXNlcjo4", - "isAuthor": False, - "lastName": "Einstein", - "openidUid": "albert@einstein.id", +snapshots['test_user 1'] = { + 'data': { + 'node': { + 'extra': '{"e": "mc2"}', + 'firstName': 'Albert', + 'hasCollidingName': False, + 'id': 'VXNlcjo4', + 'isAuthor': False, + 'lastName': 'Einstein', + 'openidUid': 'albert@einstein.id' } } } -snapshots["test_report__is_draft__unauthorized_viewer 1"] = {"data": {"node": None}} +snapshots['test_report__is_draft__unauthorized_viewer 1'] = { + 'data': { + 'node': None + } +} -snapshots["test_report__is_draft__viewer_is_not_author 1"] = {"data": {"node": None}} +snapshots['test_report__is_draft__viewer_is_not_author 1'] = { + 'data': { + 'node': None + } +} -snapshots["test_report__is_draft 1"] = { - "data": { - "node": {"id": "UmVwb3J0OjQ=", "isDraft": True, "title": "The Silmarillion"} +snapshots['test_report__is_draft 1'] = { + 'data': { + 'node': { + 'id': 'UmVwb3J0OjQ=', + 'isDraft': True, + 'title': 'The Silmarillion' + } } } diff --git a/tests/schema/snapshots/snap_test_report_drafts.py b/tests/schema/snapshots/snap_test_report_drafts.py index c84c6c7..10d81fd 100644 --- a/tests/schema/snapshots/snap_test_report_drafts.py +++ b/tests/schema/snapshots/snap_test_report_drafts.py @@ -7,23 +7,28 @@ from snapshottest import Snapshot snapshots = Snapshot() -snapshots["test_unauthenticated 1"] = {"data": {"reportDrafts": []}} +snapshots['test_unauthenticated 1'] = { + 'data': { + 'reportDrafts': [ + ] + } +} -snapshots["test_authenticated 1"] = { - "data": { - "reportDrafts": [ +snapshots['test_authenticated 1'] = { + 'data': { + 'reportDrafts': [ { - "body": "Not finished yet.", - "date": "2018-01-07 00:00:00+00:00", - "edited": "2018-01-08 09:00:00+00:00", - "id": "UmVwb3J0OjQ=", - "isDraft": True, - "otherParticipants": "", - "ourParticipants": "", - "providedBenefit": "", - "published": "2018-01-08 00:00:00+00:00", - "receivedBenefit": "", - "title": "The Silmarillion", + 'body': 'Not finished yet.', + 'date': '2018-01-07 00:00:00+00:00', + 'edited': '2018-01-08 09:00:00+00:00', + 'id': 'UmVwb3J0OjQ=', + 'isDraft': True, + 'otherParticipants': '', + 'ourParticipants': '', + 'providedBenefit': '', + 'published': '2018-01-08 00:00:00+00:00', + 'receivedBenefit': '', + 'title': 'The Silmarillion' } ] } diff --git a/tests/schema/snapshots/snap_test_search_reports.py b/tests/schema/snapshots/snap_test_search_reports.py index 6d0f9ce..b7f1490 100644 --- a/tests/schema/snapshots/snap_test_search_reports.py +++ b/tests/schema/snapshots/snap_test_search_reports.py @@ -7,259 +7,277 @@ from snapshottest import Snapshot snapshots = Snapshot() -snapshots["test_all 1"] = { - "data": { - "searchReports": { - "edges": [ +snapshots['test_all 1'] = { + 'data': { + 'searchReports': { + 'edges': [ { - "cursor": "MQ==", - "node": { - "author": { - "extra": '{"movies": 1}', - "firstName": "Winston", - "hasCollidingName": False, - "id": "QXV0aG9yOjE=", - "lastName": "Wolfe", - "totalReports": 2, + 'cursor': 'MQ==', + 'node': { + 'author': { + 'extra': '{"movies": 1}', + 'firstName': 'Winston', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjE=', + 'lastName': 'Wolfe', + 'totalReports': 2 }, - "body": "Aragorn is the King. And we have lost the Ring.", - "date": "2018-01-05 00:00:00+00:00", - "edited": "2018-01-06 07:00:00+00:00", - "extra": None, - "id": "UmVwb3J0OjM=", - "isDraft": False, - "otherParticipants": "Sauron", - "ourParticipants": "Aragorn", - "providedBenefit": "The Ring", - "published": "2018-01-06 00:00:00+00:00", - "receivedBenefit": "", - "title": "The Return of the King", - }, + 'body': 'Aragorn is the King. And we have lost the Ring.', + 'date': '2018-01-05 00:00:00+00:00', + 'edited': '2018-01-06 07:00:00+00:00', + 'extra': None, + 'id': 'UmVwb3J0OjM=', + 'isDraft': False, + 'otherParticipants': 'Sauron', + 'ourParticipants': 'Aragorn', + 'providedBenefit': 'The Ring', + 'published': '2018-01-06 00:00:00+00:00', + 'receivedBenefit': '', + 'title': 'The Return of the King' + } }, { - "cursor": "Mg==", - "node": { - "author": { - "extra": None, - "firstName": "Shaun", - "hasCollidingName": False, - "id": "QXV0aG9yOjI=", - "lastName": "Sheep", - "totalReports": 1, + 'cursor': 'Mg==', + 'node': { + 'author': { + 'extra': None, + 'firstName': 'Shaun', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjI=', + 'lastName': 'Sheep', + 'totalReports': 1 }, - "body": "Another long story.", - "date": "2018-01-03 00:00:00+00:00", - "edited": "2018-01-04 05:00:00+00:00", - "extra": '{"rings": 1}', - "id": "UmVwb3J0OjI=", - "isDraft": False, - "otherParticipants": "Saruman, Sauron", - "ourParticipants": "Frodo, Gimli, Legolas", - "providedBenefit": "", - "published": "2018-01-04 00:00:00+00:00", - "receivedBenefit": "Mithrill Jacket", - "title": "The Two Towers", - }, + 'body': 'Another long story.', + 'date': '2018-01-03 00:00:00+00:00', + 'edited': '2018-01-04 05:00:00+00:00', + 'extra': '{"rings": 1}', + 'id': 'UmVwb3J0OjI=', + 'isDraft': False, + 'otherParticipants': 'Saruman, Sauron', + 'ourParticipants': 'Frodo, Gimli, Legolas', + 'providedBenefit': '', + 'published': '2018-01-04 00:00:00+00:00', + 'receivedBenefit': 'Mithrill Jacket', + 'title': 'The Two Towers' + } }, { - "cursor": "Mw==", - "node": { - "author": { - "extra": '{"movies": 1}', - "firstName": "Winston", - "hasCollidingName": False, - "id": "QXV0aG9yOjE=", - "lastName": "Wolfe", - "totalReports": 2, + 'cursor': 'Mw==', + 'node': { + 'author': { + 'extra': '{"movies": 1}', + 'firstName': 'Winston', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjE=', + 'lastName': 'Wolfe', + 'totalReports': 2 }, - "body": "Long story short: we got the Ring!", - "date": "2018-01-01 00:00:00+00:00", - "edited": "2018-01-02 03:00:00+00:00", - "extra": None, - "id": "UmVwb3J0OjE=", - "isDraft": False, - "otherParticipants": "Saruman", - "ourParticipants": "Frodo, Gandalf", - "providedBenefit": "", - "published": "2018-01-02 00:00:00+00:00", - "receivedBenefit": "The Ring", - "title": "The Fellowship of the Ring", - }, - }, + 'body': 'Long story short: we got the Ring!', + 'date': '2018-01-01 00:00:00+00:00', + 'edited': '2018-01-02 03:00:00+00:00', + 'extra': None, + 'id': 'UmVwb3J0OjE=', + 'isDraft': False, + 'otherParticipants': 'Saruman', + 'ourParticipants': 'Frodo, Gandalf', + 'providedBenefit': '', + 'published': '2018-01-02 00:00:00+00:00', + 'receivedBenefit': 'The Ring', + 'title': 'The Fellowship of the Ring' + } + } ], - "pageInfo": { - "endCursor": "Mw==", - "hasNextPage": False, - "hasPreviousPage": False, - "startCursor": "MQ==", + 'pageInfo': { + 'endCursor': 'Mw==', + 'hasNextPage': False, + 'hasPreviousPage': False, + 'startCursor': 'MQ==' }, - "totalCount": 3, + 'totalCount': 3 } } } -snapshots["test_query 1"] = { - "data": { - "searchReports": { - "edges": [ +snapshots['test_query 1'] = { + 'data': { + 'searchReports': { + 'edges': [ { - "cursor": "MQ==", - "node": { - "author": { - "extra": None, - "firstName": "Shaun", - "hasCollidingName": False, - "id": "QXV0aG9yOjI=", - "lastName": "Sheep", - "totalReports": 1, + 'cursor': 'MQ==', + 'node': { + 'author': { + 'extra': None, + 'firstName': 'Shaun', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjI=', + 'lastName': 'Sheep', + 'totalReports': 1 }, - "body": "Another long story.", - "date": "2018-01-03 00:00:00+00:00", - "edited": "2018-01-04 05:00:00+00:00", - "extra": '{"rings": 1}', - "id": "UmVwb3J0OjI=", - "isDraft": False, - "otherParticipants": "Saruman, Sauron", - "ourParticipants": "Frodo, Gimli, Legolas", - "providedBenefit": "", - "published": "2018-01-04 00:00:00+00:00", - "receivedBenefit": "Mithrill Jacket", - "title": "The Two Towers", - }, + 'body': 'Another long story.', + 'date': '2018-01-03 00:00:00+00:00', + 'edited': '2018-01-04 05:00:00+00:00', + 'extra': '{"rings": 1}', + 'id': 'UmVwb3J0OjI=', + 'isDraft': False, + 'otherParticipants': 'Saruman, Sauron', + 'ourParticipants': 'Frodo, Gimli, Legolas', + 'providedBenefit': '', + 'published': '2018-01-04 00:00:00+00:00', + 'receivedBenefit': 'Mithrill Jacket', + 'title': 'The Two Towers' + } } ], - "totalCount": 1, + 'totalCount': 1 } } } -snapshots["test_highlight 1"] = { - "data": { - "searchReports": { - "edges": [ +snapshots['test_highlight 1'] = { + 'data': { + 'searchReports': { + 'edges': [ { - "cursor": "MQ==", - "node": { - "author": { - "extra": '{"movies": 1}', - "firstName": "Winston", - "hasCollidingName": False, - "id": "QXV0aG9yOjE=", - "lastName": "Wolfe", - "totalReports": 2, + 'cursor': 'MQ==', + 'node': { + 'author': { + 'extra': '{"movies": 1}', + 'firstName': 'Winston', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjE=', + 'lastName': 'Wolfe', + 'totalReports': 2 }, - "body": "Aragorn is the King. And we have lost the <mark>Ring</mark>.", - "date": "2018-01-05 00:00:00+00:00", - "edited": "2018-01-06 07:00:00+00:00", - "extra": None, - "id": "UmVwb3J0OjM=", - "isDraft": False, - "otherParticipants": "Sauron", - "ourParticipants": "Aragorn", - "providedBenefit": "The <mark>Ring</mark>", - "published": "2018-01-06 00:00:00+00:00", - "receivedBenefit": "", - "title": "The Return of the King", - }, + 'body': 'Aragorn is the King. And we have lost the <mark>Ring</mark>.', + 'date': '2018-01-05 00:00:00+00:00', + 'edited': '2018-01-06 07:00:00+00:00', + 'extra': None, + 'id': 'UmVwb3J0OjM=', + 'isDraft': False, + 'otherParticipants': 'Sauron', + 'ourParticipants': 'Aragorn', + 'providedBenefit': 'The <mark>Ring</mark>', + 'published': '2018-01-06 00:00:00+00:00', + 'receivedBenefit': '', + 'title': 'The Return of the King' + } }, { - "cursor": "Mg==", - "node": { - "author": { - "extra": '{"movies": 1}', - "firstName": "Winston", - "hasCollidingName": False, - "id": "QXV0aG9yOjE=", - "lastName": "Wolfe", - "totalReports": 2, + 'cursor': 'Mg==', + 'node': { + 'author': { + 'extra': '{"movies": 1}', + 'firstName': 'Winston', + 'hasCollidingName': False, + 'id': 'QXV0aG9yOjE=', + 'lastName': 'Wolfe', + 'totalReports': 2 }, - "body": "Long story short: we got the <mark>Ring</mark>!", - "date": "2018-01-01 00:00:00+00:00", - "edited": "2018-01-02 03:00:00+00:00", - "extra": None, - "id": "UmVwb3J0OjE=", - "isDraft": False, - "otherParticipants": "Saruman", - "ourParticipants": "Frodo, Gandalf", - "providedBenefit": "", - "published": "2018-01-02 00:00:00+00:00", - "receivedBenefit": "The <mark>Ring</mark>", - "title": "The Fellowship of the <mark>Ring</mark>", - }, - }, + 'body': 'Long story short: we got the <mark>Ring</mark>!', + 'date': '2018-01-01 00:00:00+00:00', + 'edited': '2018-01-02 03:00:00+00:00', + 'extra': None, + 'id': 'UmVwb3J0OjE=', + 'isDraft': False, + 'otherParticipants': 'Saruman', + 'ourParticipants': 'Frodo, Gandalf', + 'providedBenefit': '', + 'published': '2018-01-02 00:00:00+00:00', + 'receivedBenefit': 'The <mark>Ring</mark>', + 'title': 'The Fellowship of the <mark>Ring</mark>' + } + } ], - "totalCount": 2, + 'totalCount': 2 } } } -snapshots["test_first 1"] = { - "data": { - "searchReports": { - "edges": [ +snapshots['test_first 1'] = { + 'data': { + 'searchReports': { + 'edges': [ { - "cursor": "MQ==", - "node": {"id": "UmVwb3J0OjM=", "title": "The Return of the King"}, + 'cursor': 'MQ==', + 'node': { + 'id': 'UmVwb3J0OjM=', + 'title': 'The Return of the King' + } } ], - "pageInfo": { - "endCursor": "MQ==", - "hasNextPage": True, - "hasPreviousPage": False, - "startCursor": "MQ==", + 'pageInfo': { + 'endCursor': 'MQ==', + 'hasNextPage': True, + 'hasPreviousPage': False, + 'startCursor': 'MQ==' }, - "totalCount": 3, + 'totalCount': 3 } } } -snapshots["test_first_after 1"] = { - "data": { - "searchReports": { - "edges": [ +snapshots['test_first_after 1'] = { + 'data': { + 'searchReports': { + 'edges': [ { - "cursor": "Mg==", - "node": {"id": "UmVwb3J0OjI=", "title": "The Two Towers"}, + 'cursor': 'Mg==', + 'node': { + 'id': 'UmVwb3J0OjI=', + 'title': 'The Two Towers' + } } ], - "pageInfo": { - "endCursor": "Mg==", - "hasNextPage": True, - "hasPreviousPage": True, - "startCursor": "Mg==", + 'pageInfo': { + 'endCursor': 'Mg==', + 'hasNextPage': True, + 'hasPreviousPage': True, + 'startCursor': 'Mg==' }, - "totalCount": 3, + 'totalCount': 3 } } } -snapshots["test_last 1"] = { - "data": {"searchReports": None}, - "errors": [ +snapshots['test_last 1'] = { + 'data': { + 'searchReports': None + }, + 'errors': [ { - "locations": [{"column": 9, "line": 3}], - "message": 'Pagination "last" works only in combination with "before" argument.', - "path": ["searchReports"], + 'locations': [ + { + 'column': 9, + 'line': 3 + } + ], + 'message': 'Pagination "last" works only in combination with "before" argument.', + 'path': [ + 'searchReports' + ] } - ], + ] } -snapshots["test_last_before 1"] = { - "data": { - "searchReports": { - "edges": [ +snapshots['test_last_before 1'] = { + 'data': { + 'searchReports': { + 'edges': [ { - "cursor": "Mg==", - "node": {"id": "UmVwb3J0OjI=", "title": "The Two Towers"}, + 'cursor': 'Mg==', + 'node': { + 'id': 'UmVwb3J0OjI=', + 'title': 'The Two Towers' + } } ], - "pageInfo": { - "endCursor": "Mg==", - "hasNextPage": True, - "hasPreviousPage": True, - "startCursor": "Mg==", + 'pageInfo': { + 'endCursor': 'Mg==', + 'hasNextPage': True, + 'hasPreviousPage': True, + 'startCursor': 'Mg==' }, - "totalCount": 3, + 'totalCount': 3 } } } diff --git a/tests/schema/snapshots/snap_test_viewer.py b/tests/schema/snapshots/snap_test_viewer.py index 326a64b..fb88edf 100644 --- a/tests/schema/snapshots/snap_test_viewer.py +++ b/tests/schema/snapshots/snap_test_viewer.py @@ -7,27 +7,45 @@ from snapshottest import Snapshot snapshots = Snapshot() -snapshots["test_unauthenticated 1"] = {"data": {"viewer": None}} - -snapshots["test_authenticated 1"] = { - "data": { - "viewer": { - "email": "winston@wolfe.com", - "extra": '{"caliber": 45}', - "firstName": "Winston", - "hasCollidingName": False, - "id": "VXNlcjox", - "isAuthor": True, - "lastName": "Wolfe", - "openidUid": "TheWolf", +snapshots['test_unauthenticated 1'] = { + 'data': { + 'viewer': None + } +} + +snapshots['test_authenticated 1'] = { + 'data': { + 'viewer': { + 'email': 'winston@wolfe.com', + 'extra': '{"caliber": 45}', + 'firstName': 'Winston', + 'hasCollidingName': False, + 'id': 'VXNlcjox', + 'isAuthor': True, + 'lastName': 'Wolfe', + 'openidUid': 'TheWolf' } } } -snapshots["test_wrong_header 1"] = { - "errors": [{"message": 'Wrong Authorization header. Expected: "Bearer <token>"'}] +snapshots['test_wrong_header 1'] = { + 'errors': [ + { + 'message': 'Wrong Authorization header. Expected: "Bearer <token>"' + } + ] } -snapshots["test_wrong_token 1"] = {"errors": [{"message": "Invalid Token."}]} +snapshots['test_wrong_token 1'] = { + 'errors': [ + { + 'message': 'Invalid Token.' + } + ] +} -snapshots["test_unknown_user 1"] = {"data": {"viewer": None}} +snapshots['test_unknown_user 1'] = { + 'data': { + 'viewer': None + } +} diff --git a/tests/snapshots/snap_test_management.py b/tests/snapshots/snap_test_management.py deleted file mode 100644 index 5cf4f3f..0000000 --- a/tests/snapshots/snap_test_management.py +++ /dev/null @@ -1,165 +0,0 @@ -# -*- coding: utf-8 -*- -# snapshottest: v1 - https://goo.gl/zC4yUc -from __future__ import unicode_literals - -from snapshottest import Snapshot - - -snapshots = Snapshot() - -snapshots["test_create_index__check_analysis_settings 1"] = { - "analyzer": { - "czech": { - "filter": [ - "icu_folding", - "lowercase", - "czech_synonym", - "czech_stop", - "czech_stemmer", - "cs_CZ", - ], - "tokenizer": "standard", - } - }, - "filter": { - "cs_CZ": {"dedup": "true", "locale": "cs_CZ", "type": "hunspell"}, - "czech_stemmer": {"language": "czech", "type": "stemmer"}, - "czech_stop": {"stopwords": "_czech_", "type": "stop"}, - "czech_synonym": { - "synonyms_path": "analysis/cs_CZ/synonym.txt", - "type": "synonym", - }, - }, -} - -snapshots["test_create_index__check_mappings 1"] = { - "mappings": { - "report": { - "properties": { - "author_id": {"type": "keyword"}, - "body": {"analyzer": "czech", "type": "text"}, - "date": {"type": "date"}, - "extra": {"type": "object"}, - "other_participants": {"analyzer": "czech", "type": "text"}, - "our_participants": {"analyzer": "czech", "type": "text"}, - "provided_benefit": {"analyzer": "czech", "type": "text"}, - "published": {"type": "date"}, - "received_benefit": {"analyzer": "czech", "type": "text"}, - "title": {"analyzer": "czech", "type": "text"}, - } - }, - "session": { - "properties": { - "expiration": {"type": "integer"}, - "user_id": {"type": "keyword"}, - } - }, - "user": { - "properties": { - "email": {"type": "keyword"}, - "extra": {"type": "object"}, - "name": {"analyzer": "czech", "type": "text"}, - "openid_uid": {"type": "keyword"}, - } - }, - } -} - -snapshots["test_init_alias 1"] = { - "mappings": { - "report": { - "properties": { - "author_id": {"type": "keyword"}, - "body": {"analyzer": "czech", "type": "text"}, - "date": {"type": "date"}, - "extra": {"type": "object"}, - "other_participants": {"analyzer": "czech", "type": "text"}, - "our_participants": {"analyzer": "czech", "type": "text"}, - "provided_benefit": {"analyzer": "czech", "type": "text"}, - "published": {"type": "date"}, - "received_benefit": {"analyzer": "czech", "type": "text"}, - "title": {"analyzer": "czech", "type": "text"}, - } - }, - "session": { - "properties": { - "expiration": {"type": "integer"}, - "user_id": {"type": "keyword"}, - } - }, - "user": { - "properties": { - "email": {"type": "keyword"}, - "extra": {"type": "object"}, - "name": {"analyzer": "czech", "type": "text"}, - "openid_uid": {"type": "keyword"}, - } - }, - } -} - -snapshots["test_reindex__check_new_index 1"] = { - "mappings": { - "report": { - "properties": { - "author_id": {"type": "keyword"}, - "body": {"analyzer": "czech", "type": "text"}, - "date": {"type": "date"}, - "extra": {"type": "object"}, - "other_participants": {"analyzer": "czech", "type": "text"}, - "our_participants": {"analyzer": "czech", "type": "text"}, - "provided_benefit": {"analyzer": "czech", "type": "text"}, - "published": {"type": "date"}, - "received_benefit": {"analyzer": "czech", "type": "text"}, - "title": {"analyzer": "czech", "type": "text"}, - } - }, - "session": { - "properties": { - "expiration": {"type": "integer"}, - "user_id": {"type": "keyword"}, - } - }, - "user": { - "properties": { - "email": {"type": "keyword"}, - "extra": {"type": "object"}, - "name": {"analyzer": "czech", "type": "text"}, - "openid_uid": {"type": "keyword"}, - } - }, - } -} - -snapshots["test_init_documents 1"] = { - "mappings": { - "report": { - "properties": { - "author_id": {"type": "keyword"}, - "body": {"analyzer": "czech", "type": "text"}, - "date": {"type": "date"}, - "extra": {"type": "object"}, - "other_participants": {"analyzer": "czech", "type": "text"}, - "our_participants": {"analyzer": "czech", "type": "text"}, - "provided_benefit": {"analyzer": "czech", "type": "text"}, - "published": {"type": "date"}, - "received_benefit": {"analyzer": "czech", "type": "text"}, - "title": {"analyzer": "czech", "type": "text"}, - } - }, - "session": { - "properties": { - "expiration": {"type": "integer"}, - "user_id": {"type": "keyword"}, - } - }, - "user": { - "properties": { - "email": {"type": "keyword"}, - "extra": {"type": "object"}, - "name": {"analyzer": "czech", "type": "text"}, - "openid_uid": {"type": "keyword"}, - } - }, - } -} diff --git a/tests/snapshots/snap_test_middleware.py b/tests/snapshots/snap_test_middleware.py index a697267..2be80f5 100644 --- a/tests/snapshots/snap_test_middleware.py +++ b/tests/snapshots/snap_test_middleware.py @@ -7,8 +7,18 @@ from snapshottest import Snapshot snapshots = Snapshot() -snapshots["test_wrong_header 1"] = { - "errors": [{"message": 'Wrong Authorization header. Expected: "Bearer <token>"'}] +snapshots['test_wrong_header 1'] = { + 'errors': [ + { + 'message': 'Wrong Authorization header. Expected: "Bearer <token>"' + } + ] } -snapshots["test_invalid_token 1"] = {"errors": [{"message": "Invalid Token."}]} +snapshots['test_invalid_token 1'] = { + 'errors': [ + { + 'message': 'Invalid Token.' + } + ] +} diff --git a/tests/snapshots/snap_test_models.py b/tests/snapshots/snap_test_models.py deleted file mode 100644 index c957574..0000000 --- a/tests/snapshots/snap_test_models.py +++ /dev/null @@ -1,12 +0,0 @@ -# -*- coding: utf-8 -*- -# snapshottest: v1 - https://goo.gl/zC4yUc -from __future__ import unicode_literals - -from snapshottest import Snapshot, GenericRepr - - -snapshots = Snapshot() - -snapshots["test_report_is_saved_in_elasticsearch 1"] = [ - GenericRepr("ReportDoc(index='report_ded_test', doc_type='report_doc', id='2')") -] -- GitLab