Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
samonaisi committed Nov 26, 2024
1 parent 0a51121 commit aff2aa1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/projects/tests/views/test_project_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ def test_create_project_message(self, role, expected_code):
if expected_code == status.HTTP_201_CREATED:
content = response.json()
self.assertEqual(content["author"]["id"], user.id)
self.assertEqual(content["project"], self.project.id)
self.assertEqual(content["content"], payload["content"])
message_id = content["id"]
message = ProjectMessage.objects.get(id=message_id)
self.assertEqual(message.project, self.project)

@parameterized.expand(
[
Expand Down Expand Up @@ -79,9 +81,11 @@ def test_create_project_message_reply(self, role, expected_code):
if expected_code == status.HTTP_201_CREATED:
content = response.json()
self.assertEqual(content["author"]["id"], user.id)
self.assertEqual(content["project"], self.project.id)
self.assertEqual(content["content"], payload["content"])
self.assertEqual(content["reply_on"], self.reply_on.id)
message_id = content["id"]
message = ProjectMessage.objects.get(id=message_id)
self.assertEqual(message.project, self.project)


class RetrieveProjectMessageTestCase(JwtAPITestCase):
Expand Down

0 comments on commit aff2aa1

Please sign in to comment.