def test_valid_4(self): data = { str(self.candidates[0].id): 500, str(self.candidates[1].id): 0, } form = CircuitForm(data, circuit=self.circuit) self.assertTrue(form.is_valid())
def test_too_much_votes(self): data = { str(self.candidates[0].id): 1000, str(self.candidates[1].id): 2000, } form = CircuitForm(data, circuit=self.circuit) self.assertFalse(form.is_valid())
def test_negative_votes_2(self): data = { str(self.candidates[0].id): -2, str(self.candidates[1].id): -2, } form = CircuitForm(data, circuit=self.circuit) self.assertFalse(form.is_valid())