diff --git a/common/tests/conftest.py b/common/tests/conftest.py index dd8564f9..15cce082 100644 --- a/common/tests/conftest.py +++ b/common/tests/conftest.py @@ -35,6 +35,9 @@ def setup_test_environment(settings): settings.KUKKUU_REMINDER_DAYS_IN_ADVANCE = 7 settings.KUKKUU_DEFAULT_EVENT_DURATION = 120 settings.KUKKUU_ENROLLED_OCCURRENCE_IN_PAST_LEEWAY = 30 + settings.OIDC_BROWSER_TEST_API_TOKEN_AUTH = { + "ENABLED": False, + } with translation.override("fi"), freeze_time("2020-12-12"): yield shutil.rmtree("test_media", ignore_errors=True) diff --git a/events/schema.py b/events/schema.py index e80d91ae..baaa8f40 100644 --- a/events/schema.py +++ b/events/schema.py @@ -853,9 +853,10 @@ def mutate_and_get_payload(cls, root, info, **kwargs): info, project_global_id, Project ).pk - if "event_group_id" in kwargs and kwargs["event_group_id"]: + event_group_global_id = kwargs.pop("event_group_id", None) + if event_group_global_id: kwargs["event_group_id"] = get_obj_if_user_can_administer( - info, kwargs["event_group_id"], EventGroup + info, event_group_global_id, EventGroup ).pk event = get_obj_if_user_can_administer(info, kwargs.pop("id"), Event) diff --git a/events/tests/mutations.py b/events/tests/mutations.py index 0204628c..9cb18257 100644 --- a/events/tests/mutations.py +++ b/events/tests/mutations.py @@ -2,6 +2,10 @@ mutation AddEvent($input: AddEventMutationInput!) { addEvent(input: $input) { event { + id + eventGroup { + id + } translations{ languageCode name @@ -43,6 +47,10 @@ mutation UpdateEvent($input: UpdateEventMutationInput!) { updateEvent(input: $input) { event { + id + eventGroup { + id + } translations{ name shortDescription diff --git a/events/tests/snapshots/snap_test_api.py b/events/tests/snapshots/snap_test_api.py index c32d8915..ad9dbfcb 100644 --- a/events/tests/snapshots/snap_test_api.py +++ b/events/tests/snapshots/snap_test_api.py @@ -4,6 +4,7 @@ from snapshottest import Snapshot + snapshots = Snapshot() snapshots["test_add_event_group[model_perm] 1"] = { @@ -56,6 +57,8 @@ "event": { "capacityPerOccurrence": 30, "duration": 1000, + "eventGroup": {"id": "RXZlbnRHcm91cE5vZGU6MjE="}, + "id": "RXZlbnROb2RlOjE2NQ==", "image": "", "imageAltText": "Image alt text", "participantsPerInvite": "FAMILY", @@ -1290,6 +1293,8 @@ "event": { "capacityPerOccurrence": 30, "duration": 1000, + "eventGroup": None, + "id": "RXZlbnROb2RlOjI1OA==", "image": "", "imageAltText": "Image alt text", "participantsPerInvite": "FAMILY", @@ -1386,6 +1391,8 @@ "event": { "capacityPerOccurrence": 30, "duration": 1000, + "eventGroup": {"id": "RXZlbnRHcm91cE5vZGU6MjI="}, + "id": "RXZlbnROb2RlOjE4Mg==", "image": "http://testserver/media/teacher.jpg", "imageAltText": "Image alt text", "occurrences": {"edges": []}, @@ -1419,6 +1426,8 @@ "event": { "capacityPerOccurrence": 35, "duration": 181, + "eventGroup": {"id": "RXZlbnRHcm91cE5vZGU6MjM="}, + "id": "RXZlbnROb2RlOjE4Mw==", "image": "http://testserver/media/teacher.jpg", "imageAltText": "", "occurrences": {"edges": []}, diff --git a/events/tests/test_api.py b/events/tests/test_api.py index 6b2698b3..82c70cca 100644 --- a/events/tests/test_api.py +++ b/events/tests/test_api.py @@ -543,26 +543,38 @@ def test_update_event_project_user( snapshot, project_user_api_client, event, event_group ): event_variables = deepcopy(UPDATE_EVENT_VARIABLES) - event_variables["input"]["id"] = to_global_id("EventNode", event.id) - event_variables["input"]["eventGroupId"] = to_global_id( - "EventGroupNode", event_group.id - ) + event_node_id = to_global_id("EventNode", event.id) + event_group_node_id = to_global_id("EventGroupNode", event_group.id) + event_variables["input"]["id"] = event_node_id + event_variables["input"]["eventGroupId"] = event_group_node_id executed = project_user_api_client.execute( UPDATE_EVENT_MUTATION, variables=event_variables ) + assert executed["data"]["updateEvent"]["event"]["id"] == event_node_id + assert executed["data"]["updateEvent"]["event"]["eventGroup"]["id"] == ( + event_group_node_id + ) snapshot.assert_match(executed) def test_update_event_ready_for_event_group_publishing( snapshot, project_user_api_client, event, event_group ): + event.event_group = event_group + event.save() + assert event.event_group.id == event_group.id + variables = { "input": {"id": get_global_id(event), "readyForEventGroupPublishing": True}, } executed = project_user_api_client.execute( UPDATE_EVENT_MUTATION, variables=variables ) + assert executed["data"]["updateEvent"]["event"]["readyForEventGroupPublishing"] snapshot.assert_match(executed) + # the event group id should be still set + event.refresh_from_db() + assert event.event_group.id == event_group.id def test_update_ticketmaster_event(snapshot, project_user_api_client): diff --git a/languages/tests/snapshots/snap_test_add_languages_command.py b/languages/tests/snapshots/snap_test_add_languages_command.py index 9c644ecb..2d924d6b 100644 --- a/languages/tests/snapshots/snap_test_add_languages_command.py +++ b/languages/tests/snapshots/snap_test_add_languages_command.py @@ -6,9 +6,7 @@ snapshots = Snapshot() -snapshots[ - "test_add_default_languages 1" -] = """Created special language "Other" +snapshots["test_add_default_languages 1"] = """Created special language "Other" Created Arabic (ara) Created Bengali (ben) Created German (deu) @@ -76,9 +74,7 @@ "zho": {"en": "Chinese", "fi": "kiina", "sv": "Kinesiska"}, } -snapshots[ - "test_add_languages 1" -] = """Created Manide (abd) +snapshots["test_add_languages 1"] = """Created Manide (abd) Created Ngelima (agh) All done! """ @@ -88,9 +84,7 @@ "agh": {"en": "Ngelima", "fi": "Ngelima", "sv": "Ngelima"}, } -snapshots[ - "test_add_languages_and_flush 1" -] = """Flushed existing languages +snapshots["test_add_languages_and_flush 1"] = """Flushed existing languages Created Manide (abd) Created Ngelima (agh) All done! @@ -101,7 +95,5 @@ "agh": {"en": "Ngelima", "fi": "Ngelima", "sv": "Ngelima"}, } -snapshots[ - "test_no_arguments 1" -] = """Nothing to do. Hint: try --help. +snapshots["test_no_arguments 1"] = """Nothing to do. Hint: try --help. """ diff --git a/projects/tests/snapshots/snap_test_api.py b/projects/tests/snapshots/snap_test_api.py index 4d00b55c..30289f66 100644 --- a/projects/tests/snapshots/snap_test_api.py +++ b/projects/tests/snapshots/snap_test_api.py @@ -4,35 +4,44 @@ from snapshottest import Snapshot + snapshots = Snapshot() -snapshots["test_project_query_normal_user 1"] = { - "data": { - "project": { - "enrolmentLimit": 2, - "id": "UHJvamVjdE5vZGU6MQ==", - "name": "Testiprojekti", - "singleEventsAllowed": True, - "translations": [{"languageCode": "FI", "name": "Testiprojekti"}], - "year": 2020, +snapshots['test_project_query_normal_user 1'] = { + 'data': { + 'project': { + 'enrolmentLimit': 2, + 'id': 'UHJvamVjdE5vZGU6MQ==', + 'name': 'Testiprojekti', + 'singleEventsAllowed': True, + 'translations': [ + { + 'languageCode': 'FI', + 'name': 'Testiprojekti' + } + ], + 'year': 2020 } } } -snapshots["test_projects_query_normal_user 1"] = { - "data": { - "projects": { - "edges": [ +snapshots['test_projects_query_normal_user 1'] = { + 'data': { + 'projects': { + 'edges': [ { - "node": { - "enrolmentLimit": 2, - "id": "UHJvamVjdE5vZGU6MQ==", - "name": "Testiprojekti", - "singleEventsAllowed": True, - "translations": [ - {"languageCode": "FI", "name": "Testiprojekti"} + 'node': { + 'enrolmentLimit': 2, + 'id': 'UHJvamVjdE5vZGU6MQ==', + 'name': 'Testiprojekti', + 'singleEventsAllowed': True, + 'translations': [ + { + 'languageCode': 'FI', + 'name': 'Testiprojekti' + } ], - "year": 2020, + 'year': 2020 } } ] diff --git a/projects/tests/test_api.py b/projects/tests/test_api.py index 87180695..753eb6ed 100644 --- a/projects/tests/test_api.py +++ b/projects/tests/test_api.py @@ -62,7 +62,7 @@ def test_project_query_unauthenticated(snapshot, api_client, project): def test_projects_query_normal_user(snapshot, guardian_api_client, project): executed = guardian_api_client.execute(PROJECTS_QUERY) - + assert len(executed["data"]["projects"]["edges"]) == 1 snapshot.assert_match(executed) @@ -70,5 +70,4 @@ def test_project_query_normal_user(snapshot, guardian_api_client, project): variables = {"id": to_global_id("ProjectNode", project.id)} executed = guardian_api_client.execute(PROJECT_QUERY, variables=variables) - snapshot.assert_match(executed) diff --git a/pyproject.toml b/pyproject.toml index de3518b9..01cc5074 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,10 +7,10 @@ extend-exclude = ["migrations", "snapshots"] [tool.ruff.lint] # See https://docs.astral.sh/ruff/rules/ for documentation of rules extend-select = [ - "C90", # Enable mccabe (C90) rules - "I", # Enable isort (I) rules - "E", # Enable pycodestyle error (E) rules - "W", # Enable pycodestyle warning (W) rules + "C90", # Enable mccabe (C90) rules + "I", # Enable isort (I) rules + "E", # Enable pycodestyle error (E) rules + "W", # Enable pycodestyle warning (W) rules ] # Ignore conflicting lint rules: # https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules @@ -18,18 +18,18 @@ extend-select = [ # If left enabled, these could cause conflicts between the linter # (i.e. "ruff check --fix") and formatter (i.e. "ruff format"). ignore = [ - "E111", # "Indentation is not a multiple of four" - "E114", # "Indentation is not a multiple of four (comment)" - "E117", # "Over-indented" + "E111", # "Indentation is not a multiple of four" + "E114", # "Indentation is not a multiple of four (comment)" + "E117", # "Over-indented" ] [tool.ruff.lint.isort] # isort options for ruff: # https://docs.astral.sh/ruff/settings/#lintisort -order-by-type = false # Don't use type (i.e. case) to sort imports +order-by-type = false # Don't use type (i.e. case) to sort imports [tool.ruff.format] -docstring-code-format = true # Format code in docstrings +docstring-code-format = true # Format code in docstrings [tool.coverage.run] # Coverage run options: @@ -45,4 +45,8 @@ DJANGO_SETTINGS_MODULE = "kukkuu.settings" # pytest options: # https://docs.pytest.org/en/stable/reference/reference.html#configuration-options norecursedirs = ["node_modules", ".git", "venv*"] -doctest_optionflags = ["NORMALIZE_WHITESPACE", "IGNORE_EXCEPTION_DETAIL", "ALLOW_UNICODE"] +doctest_optionflags = [ + "NORMALIZE_WHITESPACE", + "IGNORE_EXCEPTION_DETAIL", + "ALLOW_UNICODE", +] diff --git a/users/tests/snapshots/snap_test_api.py b/users/tests/snapshots/snap_test_api.py index 523e0c76..4a3db706 100644 --- a/users/tests/snapshots/snap_test_api.py +++ b/users/tests/snapshots/snap_test_api.py @@ -4,32 +4,35 @@ from snapshottest import Snapshot + snapshots = Snapshot() -snapshots["test_guardians_query_normal_user 1"] = { - "data": { - "guardians": { - "edges": [ +snapshots['test_guardians_query_normal_user 1'] = { + 'data': { + 'guardians': { + 'edges': [ { - "node": { - "email": "michellewalker@example.net", - "firstName": "Andrew", - "lastName": "Eaton", - "phoneNumber": "001-311-571-5910x23202", - "relationships": { - "edges": [ + 'node': { + 'email': 'michellewalker@example.net', + 'firstName': 'Andrew', + 'lastName': 'Eaton', + 'phoneNumber': '001-311-571-5910x23202', + 'relationships': { + 'edges': [ { - "node": { - "child": { - "birthyear": 2023, - "name": "Nicholas Chavez", - "project": {"year": 2020}, + 'node': { + 'child': { + 'birthyear': 2023, + 'name': 'Nicholas Chavez', + 'project': { + 'year': 2020 + } }, - "type": "PARENT", + 'type': 'PARENT' } } ] - }, + } } } ] @@ -37,331 +40,373 @@ } } -snapshots["test_guardians_query_project_user 1"] = { - "data": { - "guardians": { - "edges": [ +snapshots['test_guardians_query_project_user 1'] = { + 'data': { + 'guardians': { + 'edges': [ { - "node": { - "email": "debbie77@example.com", - "firstName": "Guardian having children in own and another project", - "lastName": "Should be visible 1/2", - "phoneNumber": "(971)824-0675x0649", - "relationships": { - "edges": [ + 'node': { + 'email': 'debbie77@example.com', + 'firstName': 'Guardian having children in own and another project', + 'lastName': 'Should be visible 1/2', + 'phoneNumber': '(971)824-0675x0649', + 'relationships': { + 'edges': [ { - "node": { - "child": { - "birthyear": 2019, - "name": "Cynthia Holmes", - "project": {"year": 2020}, + 'node': { + 'child': { + 'birthyear': 2019, + 'name': 'Cynthia Holmes', + 'project': { + 'year': 2020 + } }, - "type": "PARENT", + 'type': 'PARENT' } } ] - }, + } } }, { - "node": { - "email": "michellewalker@example.net", - "firstName": "Another project own guardian", - "lastName": "Should be visible 2/2", - "phoneNumber": "420.928.1307", - "relationships": { - "edges": [ + 'node': { + 'email': 'michellewalker@example.net', + 'firstName': 'Another project own guardian', + 'lastName': 'Should be visible 2/2', + 'phoneNumber': '420.928.1307', + 'relationships': { + 'edges': [ { - "node": { - "child": { - "birthyear": 2022, - "name": "Sara Johnson", - "project": {"year": 2030}, + 'node': { + 'child': { + 'birthyear': 2022, + 'name': 'Sara Johnson', + 'project': { + 'year': 2030 + } }, - "type": "OTHER_RELATION", + 'type': 'OTHER_RELATION' } } ] - }, + } } - }, + } ] } } } -snapshots["test_my_admin_profile_project_admin[has_also_model_perm] 1"] = { - "data": { - "myAdminProfile": { - "projects": { - "edges": [ +snapshots['test_my_admin_profile_project_admin[has_also_model_perm] 1'] = { + 'data': { + 'myAdminProfile': { + 'projects': { + 'edges': [ { - "node": { - "myPermissions": { - "manageEventGroups": True, - "publish": True, + 'node': { + 'myPermissions': { + 'manageEventGroups': True, + 'publish': True }, - "name": "Helsingin kaupunginorkesteri", + 'name': 'Helsingin kaupunginorkesteri' } }, { - "node": { - "myPermissions": { - "manageEventGroups": True, - "publish": True, + 'node': { + 'myPermissions': { + 'manageEventGroups': True, + 'publish': True }, - "name": "project where base admin object perm but no other object perms", + 'name': 'project where base admin object perm but no other object perms' } }, { - "node": { - "myPermissions": { - "manageEventGroups": True, - "publish": True, + 'node': { + 'myPermissions': { + 'manageEventGroups': True, + 'publish': True }, - "name": "project where base admin object perm and other object perms", + 'name': 'project where base admin object perm and other object perms' } }, { - "node": { - "myPermissions": { - "manageEventGroups": True, - "publish": True, + 'node': { + 'myPermissions': { + 'manageEventGroups': True, + 'publish': True }, - "name": "project where no object perms", + 'name': 'project where no object perms' } - }, + } ] } } } } -snapshots["test_my_admin_profile_project_admin[no_model_perm] 1"] = { - "data": { - "myAdminProfile": { - "projects": { - "edges": [ +snapshots['test_my_admin_profile_project_admin[no_model_perm] 1'] = { + 'data': { + 'myAdminProfile': { + 'projects': { + 'edges': [ { - "node": { - "myPermissions": { - "manageEventGroups": False, - "publish": False, + 'node': { + 'myPermissions': { + 'manageEventGroups': False, + 'publish': False }, - "name": "project where base admin object perm but no other object perms", + 'name': 'project where base admin object perm but no other object perms' } }, { - "node": { - "myPermissions": { - "manageEventGroups": True, - "publish": True, + 'node': { + 'myPermissions': { + 'manageEventGroups': True, + 'publish': True }, - "name": "project where base admin object perm and other object perms", + 'name': 'project where base admin object perm and other object perms' } - }, + } ] } } } } -snapshots["test_my_communication_subscriptions_query_as_logged_in[False] 1"] = { - "data": { - "myCommunicationSubscriptions": { - "firstName": "Michael", - "hasAcceptedCommunication": False, - "language": "fi", - "lastName": "Patton", +snapshots['test_my_communication_subscriptions_query_as_logged_in[False] 1'] = { + 'data': { + 'myCommunicationSubscriptions': { + 'firstName': 'Michael', + 'hasAcceptedCommunication': False, + 'language': 'fi', + 'lastName': 'Patton' } } } -snapshots["test_my_communication_subscriptions_query_as_logged_in[True] 1"] = { - "data": { - "myCommunicationSubscriptions": { - "firstName": "Michael", - "hasAcceptedCommunication": True, - "language": "fi", - "lastName": "Patton", +snapshots['test_my_communication_subscriptions_query_as_logged_in[True] 1'] = { + 'data': { + 'myCommunicationSubscriptions': { + 'firstName': 'Michael', + 'hasAcceptedCommunication': True, + 'language': 'fi', + 'lastName': 'Patton' } } } -snapshots[ - "test_my_communication_subscriptions_query_with_auth_verification_token 1" -] = { - "data": { - "myCommunicationSubscriptions": { - "firstName": "Michael", - "hasAcceptedCommunication": True, - "language": "fi", - "lastName": "Patton", +snapshots['test_my_communication_subscriptions_query_with_auth_verification_token 1'] = { + 'data': { + 'myCommunicationSubscriptions': { + 'firstName': 'Michael', + 'hasAcceptedCommunication': True, + 'language': 'fi', + 'lastName': 'Patton' } } } -snapshots["test_my_profile_no_profile 1"] = {"data": {"myProfile": None}} +snapshots['test_my_profile_no_profile 1'] = { + 'data': { + 'myProfile': None + } +} -snapshots["test_my_profile_query 1"] = { - "data": { - "myProfile": { - "email": "michellewalker@example.net", - "firstName": "Robert", - "hasAcceptedCommunication": False, - "language": "FI", - "languagesSpokenAtHome": {"edges": []}, - "lastName": "Crane", - "phoneNumber": "303.746.6972x70117", - "relationships": { - "edges": [ +snapshots['test_my_profile_query 1'] = { + 'data': { + 'myProfile': { + 'email': 'michellewalker@example.net', + 'firstName': 'Robert', + 'hasAcceptedCommunication': False, + 'language': 'FI', + 'languagesSpokenAtHome': { + 'edges': [ + ] + }, + 'lastName': 'Crane', + 'phoneNumber': '303.746.6972x70117', + 'relationships': { + 'edges': [ { - "node": { - "child": { - "birthyear": 2019, - "name": "Ashley Hernandez", - "postalCode": "28130", + 'node': { + 'child': { + 'birthyear': 2019, + 'name': 'Ashley Hernandez', + 'postalCode': '28130' }, - "type": "OTHER_GUARDIAN", + 'type': 'OTHER_GUARDIAN' } } ] - }, + } } } } -snapshots["test_my_profile_query_email[] 1"] = { - "data": {"myProfile": {"email": "user@example.com"}} +snapshots['test_my_profile_query_email[] 1'] = { + 'data': { + 'myProfile': { + 'email': 'user@example.com' + } + } } -snapshots["test_my_profile_query_email[guardian@example.com] 1"] = { - "data": {"myProfile": {"email": "guardian@example.com"}} +snapshots['test_my_profile_query_email[guardian@example.com] 1'] = { + 'data': { + 'myProfile': { + 'email': 'guardian@example.com' + } + } } -snapshots["test_request_email_change_token_mutation 1"] = { - "data": { - "requestEmailUpdateToken": { - "email": "new-email@kummilapset.fi", - "emailUpdateTokenRequested": True, +snapshots['test_request_email_change_token_mutation 1'] = { + 'data': { + 'requestEmailUpdateToken': { + 'email': 'new-email@kummilapset.fi', + 'emailUpdateTokenRequested': True } } } -snapshots["test_update_my_communication_subscriptions_as_logged_in[False] 1"] = { - "data": { - "updateMyCommunicationSubscriptions": { - "guardian": { - "firstName": "Michael", - "hasAcceptedCommunication": True, - "language": "fi", - "lastName": "Patton", +snapshots['test_update_my_communication_subscriptions_as_logged_in[False] 1'] = { + 'data': { + 'updateMyCommunicationSubscriptions': { + 'guardian': { + 'firstName': 'Michael', + 'hasAcceptedCommunication': True, + 'language': 'fi', + 'lastName': 'Patton' } } } } -snapshots["test_update_my_communication_subscriptions_as_logged_in[True] 1"] = { - "data": { - "updateMyCommunicationSubscriptions": { - "guardian": { - "firstName": "Michael", - "hasAcceptedCommunication": False, - "language": "fi", - "lastName": "Patton", +snapshots['test_update_my_communication_subscriptions_as_logged_in[True] 1'] = { + 'data': { + 'updateMyCommunicationSubscriptions': { + 'guardian': { + 'firstName': 'Michael', + 'hasAcceptedCommunication': False, + 'language': 'fi', + 'lastName': 'Patton' } } } } -snapshots[ - "test_update_my_communication_subscriptions_returns_errors_without_required_args[variables0] 1" -] = { - "data": None, - "errors": [ +snapshots['test_update_my_communication_subscriptions_returns_errors_without_required_args[variables0] 1'] = { + 'data': None, + 'errors': [ { - "extensions": {"code": "GENERAL_ERROR"}, - "locations": [{"column": 3, "line": 3}], - "message": "Variable '$input' got invalid value {}; Field 'hasAcceptedCommunication' of required type 'Boolean!' was not provided.", + 'extensions': { + 'code': 'GENERAL_ERROR' + }, + 'locations': [ + { + 'column': 3, + 'line': 3 + } + ], + 'message': "Variable '$input' got invalid value {}; Field 'hasAcceptedCommunication' of required type 'Boolean!' was not provided." } - ], + ] } -snapshots[ - "test_update_my_communication_subscriptions_returns_errors_without_required_args[variables1] 1" -] = { - "data": None, - "errors": [ +snapshots['test_update_my_communication_subscriptions_returns_errors_without_required_args[variables1] 1'] = { + 'data': None, + 'errors': [ { - "extensions": {"code": "GENERAL_ERROR"}, - "locations": [{"column": 3, "line": 3}], - "message": "Variable '$input' of required type 'UpdateMyCommunicationSubscriptionsMutationInput!' was not provided.", + 'extensions': { + 'code': 'GENERAL_ERROR' + }, + 'locations': [ + { + 'column': 3, + 'line': 3 + } + ], + 'message': "Variable '$input' of required type 'UpdateMyCommunicationSubscriptionsMutationInput!' was not provided." } - ], + ] } -snapshots[ - "test_update_my_communication_subscriptions_returns_errors_without_required_args[variables2] 1" -] = { - "data": None, - "errors": [ +snapshots['test_update_my_communication_subscriptions_returns_errors_without_required_args[variables2] 1'] = { + 'data': None, + 'errors': [ { - "extensions": {"code": "GENERAL_ERROR"}, - "locations": [{"column": 3, "line": 3}], - "message": "Variable '$input' got invalid value {'authToken': 'what ever'}; Field 'hasAcceptedCommunication' of required type 'Boolean!' was not provided.", + 'extensions': { + 'code': 'GENERAL_ERROR' + }, + 'locations': [ + { + 'column': 3, + 'line': 3 + } + ], + 'message': "Variable '$input' got invalid value {'authToken': 'what ever'}; Field 'hasAcceptedCommunication' of required type 'Boolean!' was not provided." } - ], + ] } -snapshots[ - "test_update_my_communication_subscriptions_with_auth_verification_token[False] 1" -] = { - "data": { - "updateMyCommunicationSubscriptions": { - "guardian": { - "firstName": "Michael", - "hasAcceptedCommunication": True, - "language": "fi", - "lastName": "Patton", +snapshots['test_update_my_communication_subscriptions_with_auth_verification_token[False] 1'] = { + 'data': { + 'updateMyCommunicationSubscriptions': { + 'guardian': { + 'firstName': 'Michael', + 'hasAcceptedCommunication': True, + 'language': 'fi', + 'lastName': 'Patton' } } } } -snapshots[ - "test_update_my_communication_subscriptions_with_auth_verification_token[True] 1" -] = { - "data": { - "updateMyCommunicationSubscriptions": { - "guardian": { - "firstName": "Michael", - "hasAcceptedCommunication": False, - "language": "fi", - "lastName": "Patton", +snapshots['test_update_my_communication_subscriptions_with_auth_verification_token[True] 1'] = { + 'data': { + 'updateMyCommunicationSubscriptions': { + 'guardian': { + 'firstName': 'Michael', + 'hasAcceptedCommunication': False, + 'language': 'fi', + 'lastName': 'Patton' } } } } -snapshots["test_update_my_email_mutation[changed-email@kummilapset.fi-True] 1"] = { - "data": {"updateMyEmail": {"myProfile": {"email": "changed-email@kummilapset.fi"}}} +snapshots['test_update_my_email_mutation[changed-email@kummilapset.fi-True] 1'] = { + 'data': { + 'updateMyEmail': { + 'myProfile': { + 'email': 'changed-email@kummilapset.fi' + } + } + } } -snapshots["test_update_my_profile_mutation 1"] = { - "data": { - "updateMyProfile": { - "myProfile": { - "firstName": "Updated First Name", - "hasAcceptedCommunication": False, - "language": "EN", - "languagesSpokenAtHome": { - "edges": [ - {"node": {"alpha3Code": "swe"}}, - {"node": {"alpha3Code": "fin"}}, +snapshots['test_update_my_profile_mutation 1'] = { + 'data': { + 'updateMyProfile': { + 'myProfile': { + 'firstName': 'Updated First Name', + 'hasAcceptedCommunication': False, + 'language': 'EN', + 'languagesSpokenAtHome': { + 'edges': [ + { + 'node': { + 'alpha3Code': 'swe' + } + }, + { + 'node': { + 'alpha3Code': 'fin' + } + } ] }, - "lastName": "Updated Last Name", - "phoneNumber": "Updated phone number", + 'lastName': 'Updated Last Name', + 'phoneNumber': 'Updated phone number' } } } diff --git a/users/tests/snapshots/snap_test_services.py b/users/tests/snapshots/snap_test_services.py index c79d56c5..7567228a 100644 --- a/users/tests/snapshots/snap_test_services.py +++ b/users/tests/snapshots/snap_test_services.py @@ -6,9 +6,7 @@ snapshots = Snapshot() -snapshots[ - "test_generate_children_event_history_markdown_with_data 1" -] = """# Jason Berg +snapshots["test_generate_children_event_history_markdown_with_data 1"] = """# Jason Berg 1. **Event 3 for child2:** 16.6.2023 00:00