From e7945c835d2c7fb570f36b6168c5a1cb99630ca2 Mon Sep 17 00:00:00 2001 From: sniedzielski Date: Fri, 18 Oct 2024 17:45:19 +0200 Subject: [PATCH] OM-344: fixed utils test helper for group of workers part 2 --- worker_voucher/tests/data/gql_payloads.py | 2 +- worker_voucher/tests/test_gql_group_of_worker_create.py | 6 +++++- worker_voucher/tests/test_gql_group_of_worker_update.py | 9 ++++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/worker_voucher/tests/data/gql_payloads.py b/worker_voucher/tests/data/gql_payloads.py index 9d294b4..cb2e71a 100644 --- a/worker_voucher/tests/data/gql_payloads.py +++ b/worker_voucher/tests/data/gql_payloads.py @@ -118,7 +118,7 @@ mutation updateGroupOfWorker { createOrUpdateGroupOfWorkers(input: { id: "%s", - insureesChfId: ["%s", "%s"], + insureesChfId: ["%s"], economicUnitCode: "%s", name: "%s", clientMutationId: "%s" diff --git a/worker_voucher/tests/test_gql_group_of_worker_create.py b/worker_voucher/tests/test_gql_group_of_worker_create.py index 5c08046..8c984a3 100644 --- a/worker_voucher/tests/test_gql_group_of_worker_create.py +++ b/worker_voucher/tests/test_gql_group_of_worker_create.py @@ -51,9 +51,13 @@ def test_create_group_of_worker_success(self): self.name, mutation_id ) - + print(payload) _ = self.gql_client.execute(payload, context=self.gql_context) + print(_) + mutation_log = MutationLog.objects.get(client_mutation_id=mutation_id) + print(mutation_log) group = GroupOfWorker.objects.filter(name=self.name) + print(group) workers_group = WorkerGroup.objects.filter(group=group.first()) self.assertEquals(group.count(), 1) self.assertEquals(workers_group.count(), 1) diff --git a/worker_voucher/tests/test_gql_group_of_worker_update.py b/worker_voucher/tests/test_gql_group_of_worker_update.py index d76f28d..f855547 100644 --- a/worker_voucher/tests/test_gql_group_of_worker_update.py +++ b/worker_voucher/tests/test_gql_group_of_worker_update.py @@ -82,10 +82,13 @@ def test_update_group_of_worker_change_name_success(self): changed_name, mutation_id ) - + print(payload) workers_group = WorkerGroup.objects.filter(group=self.group) self.assertEquals(workers_group.count(), 0) _ = self.gql_client.execute(payload, context=self.gql_context) + print(_) + mutation_log = MutationLog.objects.get(client_mutation_id=mutation_id) + print(mutation_log) group = GroupOfWorker.objects.filter(name=self.name) workers_group = WorkerGroup.objects.filter(group=group.first()) self.assertEquals(group.count(), 1) @@ -107,6 +110,8 @@ def test_update_group_of_worker_remove_one_of_worker_success(self): workers_group = WorkerGroup.objects.filter(group=self.group) self.assertEquals(workers_group.count(), 0) _ = self.gql_client.execute(payload, context=self.gql_context) + mutation_log = MutationLog.objects.get(client_mutation_id=mutation_id) + print(mutation_log) group = GroupOfWorker.objects.filter(name=self.name) workers_group = WorkerGroup.objects.filter(group=group.first()) self.assertEquals(group.count(), 1) @@ -123,6 +128,8 @@ def test_update_group_of_worker_remove_one_of_worker_success(self): ) _ = self.gql_client.execute(payload, context=self.gql_context) + mutation_log = MutationLog.objects.get(client_mutation_id=mutation_id) + print(mutation_log) group = GroupOfWorker.objects.filter(name=self.name) workers_group = WorkerGroup.objects.filter(group=group.first()) self.assertEquals(group.count(), 1)