def test_create_draft_poll(self): data = dict( title='Where do you live?', description='Now, we collecting location information about a visitors our site. And so, where you is?', status=Poll.CHOICES_STATUS.draft, ) poll = Poll(**data) poll.full_clean() poll.save() self.assertEqual(poll.title, data['title']) self.assertEqual(poll.status, data['status']) self.assertEqual(poll.description, data['description'])
def test_create_opened_poll(self): data = dict( title='Who is who?', description='Us very interesting - who are you?', status=Poll.CHOICES_STATUS.opened, ) poll = Poll(**data) poll.full_clean() poll.save() self.assertEqual(poll.title, data['title']) self.assertEqual(poll.status, data['status']) self.assertEqual(poll.description, data['description'])
def test_create_closed_poll(self): data = dict( title='I you liked our website?', description='Us very interesting you opinion about quality our site?', status=Poll.CHOICES_STATUS.closed, ) poll = Poll(**data) poll.full_clean() poll.save() self.assertEqual(poll.title, data['title']) self.assertEqual(poll.status, data['status']) self.assertEqual(poll.description, data['description'])
def test_update_poll(self): data = dict( title='What do you think about new design of the website?', description='As you see, after little delay, we given you new version of our website.', status=Poll.CHOICES_STATUS.opened, ) poll = Poll(**data) poll.full_clean() poll.save() self.assertEqual(poll.title, data['title']) self.assertEqual(poll.status, data['status']) self.assertEqual(poll.description, data['description'])