From 38c43bd4041b41371176acd56945ff57b7dbfd89 Mon Sep 17 00:00:00 2001 From: Isamunval Date: Thu, 6 Jan 2022 17:01:44 +0100 Subject: [PATCH] =?UTF-8?q?Test:=20Finalizaci=C3=B3n=20test=20d'Hondt;=20#?= =?UTF-8?q?27?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- decide/postproc/tests.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/decide/postproc/tests.py b/decide/postproc/tests.py index 28d9120cbd..c3f22f736d 100644 --- a/decide/postproc/tests.py +++ b/decide/postproc/tests.py @@ -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)