Skip to content

Commit

Permalink
Fix test cases after removal of exception handling blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aadesh-Baral committed Jul 17, 2023
1 parent b986587 commit 99412a2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/backend/integration/api/teams/test_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,10 @@ def test_add_members_to_team_by_non_admin_fails(self):
)
response_body = response.get_json()
self.assertEqual(response.status_code, 500)
self.assertEqual(response_body["SubCode"], "InternalServerError")
error_resp = response_body["error"]
self.assertEqual(error_resp["sub_code"], "INTERNAL_SERVER_ERROR")
self.assertTrue(
"User is not allowed to add member to the team" in response_body["Error"]
"User is not allowed to add member to the team" in error_resp["message"]
)

def test_add_non_existent_members_to_team_fails(self):
Expand All @@ -252,7 +253,8 @@ def test_add_non_existent_members_to_team_fails(self):
)
response_body = response.get_json()
self.assertEqual(response.status_code, 500)
self.assertEqual(response_body["SubCode"], "InternalServerError")
error_resp = response_body["error"]
self.assertEqual(error_resp["sub_code"], "INTERNAL_SERVER_ERROR")

def test_add_members_to_non_existent_team_fails(self):
"""
Expand All @@ -267,8 +269,10 @@ def test_add_members_to_non_existent_team_fails(self):
headers={"Authorization": self.admin_token},
)
response_body = response.get_json()
print(response_body)
self.assertEqual(response.status_code, 500)
self.assertEqual(response_body["SubCode"], "InternalServerError")
error_resp = response_body["error"]
self.assertEqual(error_resp["sub_code"], "INTERNAL_SERVER_ERROR")


class TestTeamsActionsLeaveAPI(BaseTestCase):
Expand Down

0 comments on commit 99412a2

Please sign in to comment.