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 authored and frjo committed Nov 4, 2024
1 parent 944c8a8 commit 0d9941c
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 @@ -713,9 +713,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 @@ -756,15 +756,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 @@ -777,14 +774,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 0d9941c

Please sign in to comment.