def test_can_not_save_empty_text(self): poll = Poll.objects.create(text='text') choice = Choice(poll=poll, text='') with self.assertRaises(ValidationError): choice.full_clean()
def test_requires_poll(self): choice = Choice(text='text') with self.assertRaises(ValidationError): choice.full_clean()