Skip to content

Commit

Permalink
Test: Finalización test d'Hondt; EGCETSII#27
Browse files Browse the repository at this point in the history
  • Loading branch information
isamunval committed Jan 6, 2022
1 parent 3208034 commit 38c43bd
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion decide/postproc/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,18 @@ def test_dhondt(self):
{ "option": "Option 5", "number": 5, "votes": 5 },
]
}


expected_result = [
{ "option": "Option 1", "number": 1, "votes": 20, "postproc": 5 },
{ "option": "Option 2", "number": 2, "votes": 11, "postproc": 2 },
{ "option": "Option 4", "number": 4, "votes": 10, "postproc": 2 },
{ "option": "Option 5", "number": 5, "votes": 5, "postproc": 1 },
{ "option": "Option 3", "number": 3, "votes": 0, "postproc": 0 },
]

response = self.client.post("/postproc/", data, format="json")
self.assertEqual(response.status_code, 200)

values = response.json()
self.assertEqual(values, expected_result)

0 comments on commit 38c43bd

Please sign in to comment.