Skip to content

Commit

Permalink
OM-344: fixed utils test helper for group of workers part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
sniedzielski committed Oct 18, 2024
1 parent 6526a1e commit e7945c8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion worker_voucher/tests/data/gql_payloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
mutation updateGroupOfWorker {
createOrUpdateGroupOfWorkers(input: {
id: "%s",
insureesChfId: ["%s", "%s"],
insureesChfId: ["%s"],
economicUnitCode: "%s",
name: "%s",
clientMutationId: "%s"
Expand Down
6 changes: 5 additions & 1 deletion worker_voucher/tests/test_gql_group_of_worker_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 8 additions & 1 deletion worker_voucher/tests/test_gql_group_of_worker_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit e7945c8

Please sign in to comment.