예제 #1
0
 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()
예제 #2
0
 def test_requires_poll(self):
     choice = Choice(text='text')
     with self.assertRaises(ValidationError):
         choice.full_clean()