Skip to content

Commit

Permalink
OP-2220: fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sniedzielski committed Dec 13, 2024
1 parent 2cc8515 commit 4fb03f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_create_comment_individual_success(self):
comment = Comment.objects.get(ticket_id=self.existing_ticket.id)
self.assertEquals(comment.ticket.id, self.existing_ticket.id)
self.assertEquals(comment.comment, self.comment)
self.assertEquals(comment.commenter_id, self.individual.id)
self.assertEquals(comment.commenter_id, str(self.individual.id))
self.assertEquals(comment.is_resolution, False)
self.assertEquals(str(comment.commenter_type), self.type)

Expand All @@ -83,7 +83,7 @@ def test_create_comment_anonymous_user_success(self):
self.assertEquals(comment.comment, self.comment)
self.assertEquals(comment.commenter_id, None)
self.assertEquals(comment.is_resolution, False)
self.assertEquals(str(comment.commenter_type), None)
self.assertEquals(comment.commenter_type, None)

@classmethod
def __create_individual(cls):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
from graphene import Schema
from graphene.test import Client
from core.test_helpers import create_test_interactive_user
from grievance_social_protection.models import (
Comment,
Ticket
)
from grievance_social_protection.schema import Query, Mutation
from grievance_social_protection.tests.gql_payloads import gql_mutation_resolve_ticket_by_comment
from grievance_social_protection.tests.test_helpers import (
Expand Down Expand Up @@ -46,6 +50,8 @@ def test_resolve_ticket_by_comment_success(self):

_ = self.gql_client.execute(payload, context=self.gql_context)
mutation_log = MutationLog.objects.get(client_mutation_id=mutation_id)
comment = Comment.objects.get(id=self.existing_comment.id)
ticket = Ticket.objects.get(id=self.existing_ticket.id)
self.assertFalse(mutation_log.error)
self.assertEquals(self.existing_comment.is_resolution, True)
self.assertEquals(self.existing_ticket.status, self.status)
self.assertEquals(comment.is_resolution, True)
self.assertEquals(ticket.status, self.status)

0 comments on commit 4fb03f9

Please sign in to comment.