def test_topic_poll_status_when_it_is_not_in_event(self): event = test_helper.create_passed_event() topic = Topic(name='test', content='test', description='', author=event.last_modified_by, accepted=True) topic.last_modified_by=event.last_modified_by topic.save() self.assertEquals(u'该话题尚未加入任何活动,无法开始投票', topic.poll_status) # it's not related to accepted topic.accepted = False topic.save() self.assertEquals(u'该话题尚未加入任何活动,无法开始投票', topic.poll_status)
def test_topic_poll_status_when_event_is_passed(self): event = test_helper.create_passed_event() topic = Topic(name='test', content='test', description='', in_event=event, author=event.last_modified_by, accepted=True) topic.last_modified_by = event.last_modified_by topic.save() self.assertEquals(u'本话题所属活动已经结束', topic.poll_status)
def test_topic_poll_status_when_it_is_not_accepted_by_admin(self): event = test_helper.create_passed_event() topic = Topic(name='test', content='test', description='', in_event=event, author=event.last_modified_by, accepted=False) topic.last_modified_by = event.last_modified_by topic.save() self.assertEquals(u'活动等待管理员审核中,审核完毕后即可开始投票', topic.poll_status)
def test_topic_poll_status_when_event_is_passed(self): event = test_helper.create_passed_event() topic = Topic(name='test', content='test', description='', in_event=event, author=event.last_modified_by, accepted=True) topic.last_modified_by=event.last_modified_by topic.save() self.assertEquals(u'本话题所属活动已经结束', topic.poll_status)
def test_topic_poll_status_when_it_is_not_accepted_by_admin(self): event = test_helper.create_passed_event() topic = Topic(name='test', content='test', description='', in_event=event, author=event.last_modified_by, accepted=False) topic.last_modified_by=event.last_modified_by topic.save() self.assertEquals(u'活动等待管理员审核中,审核完毕后即可开始投票', topic.poll_status)