Skip to content

Commit 4f211a0

Browse files
committed
Test: Test d'hondt sin votos; EGCETSII#27
1 parent e2728aa commit 4f211a0

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

decide/postproc/tests.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,3 +385,27 @@ def test_dhondt_mal(self):
385385
response = self.client.post('/postproci/', data, format='json')
386386
self.assertEqual(response.status_code, 404)
387387

388+
def test_dhondt_noVotes(self):
389+
"""
390+
* Definición: Test negativo que no recibe votos
391+
* Entrada: Votación
392+
- Number: id del partido
393+
- Option: nombre de la opción
394+
- Votes: Numero de votos que recibe en la votación
395+
* Salida: Código 200 con los datos de entrada junto con el postprocesado, de forma
396+
que ningún partido recibe escaños
397+
"""
398+
399+
data = {
400+
"type": "DHONDT",
401+
"seats": 8,
402+
"options": [
403+
{ "option": "Option 1", "number": 1, "votes": 0 },
404+
{ "option": "Option 2", "number": 2, "votes": 0 },
405+
{ "option": "Option 3", "number": 3, "votes": 0 },
406+
{ "option": "Option 4", "number": 4, "votes": 0 },
407+
{ "option": "Option 5", "number": 5, "votes": 0 },
408+
{ "option": "Option 6", "number": 6, "votes": 0 },
409+
]
410+
}
411+

0 commit comments

Comments
 (0)