Skip to content

Commit

Permalink
Fix tests for message check{
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepsajan0 committed Oct 28, 2024
1 parent ecada27 commit 206e3b3
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions hypha/apply/projects/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,9 +712,9 @@ def test_approve_unapproved_contract(self):
response = self.post_page(
project,
{
"form-submitted-approve_contract_form": "",
"id": contract.id,
},
view_name="contract_approve",
)
self.assertEqual(response.status_code, 200)

Expand Down Expand Up @@ -755,15 +755,12 @@ def test_approve_unsigned_contract(self):
response = self.post_page(
project,
{
"form-submitted-approve_contract_form": "",
"id": contract.id,
},
view_name="contract_approve",
)
self.assertEqual(response.status_code, 200)

messages = list(response.context["messages"])
self.assertEqual(len(messages), 1)

def test_attempt_to_approve_non_latest(self):
project = ProjectFactory()
contract_attempt = ContractFactory(
Expand All @@ -776,14 +773,12 @@ def test_attempt_to_approve_non_latest(self):
response = self.post_page(
project,
{
"form-submitted-approve_contract_form": "",
"id": contract_attempt.id,
},
view_name="contract_approve",
)
self.assertEqual(response.status_code, 200)

messages = list(response.context["messages"])
self.assertEqual(len(messages), 1)
contract_attempt.refresh_from_db()
contract_meant.refresh_from_db()
self.assertIsNone(contract_attempt.approver)
Expand Down

0 comments on commit 206e3b3

Please sign in to comment.