From 32080341d8359c376548140e5a155861d5bc2af6 Mon Sep 17 00:00:00 2001 From: Isamunval Date: Thu, 6 Jan 2022 16:59:44 +0100 Subject: [PATCH] =?UTF-8?q?Test:=20Continuaci=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 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/decide/postproc/tests.py b/decide/postproc/tests.py index 834f9c86ce..28d9120cbd 100644 --- a/decide/postproc/tests.py +++ b/decide/postproc/tests.py @@ -291,3 +291,27 @@ def test_dhondt(self): ] } + expected_result = [ + { "option": "Option 1", "number": 1, "votes": 5, "postproc": 3 }, + { "option": "Option 5", "number": 5, "votes": 5, "postproc": 3 }, + { "option": "Option 3", "number": 3, "votes": 3, "postproc": 1 }, + { "option": "Option 4", "number": 4, "votes": 2, "postproc": 1 }, + { "option": "Option 2", "number": 2, "votes": 0, "postproc": 0 }, + { "option": "Option 6", "number": 6, "votes": 1, "postproc": 0 }, + ] + + + data = { + "type": "DHONDT", + "seats": 10, + "options": [ + { "option": "Option 1", "number": 1, "votes": 20 }, + { "option": "Option 2", "number": 2, "votes": 11 }, + { "option": "Option 3", "number": 3, "votes": 0 }, + { "option": "Option 4", "number": 4, "votes": 10 }, + { "option": "Option 5", "number": 5, "votes": 5 }, + ] + } + + +