def standard_base(test_obj): test_obj.user = new_user('user') test_obj.admin = new_user('admin', admin=True) test_obj.contest = ContestFactory.from_dict({ 'name': 'Contest', 'code': 'contest', }).create()
def setUp(self): standard_base(self) self.team = Team(contest=self.contest, name='Team') self.team.save() join_team(self.user, self.team) self.user2 = new_user('another_user') self.user3 = new_user('yet_another_user')
def setUp(self): self.user = new_user('user') self.user_no_team = new_user('user_no_team') self.contest = ContestFactory.from_dict({ 'name': 'Contest', 'code': 'contest', }).create() self.team = Team(contest=self.contest, name='Team') self.team.save() join_team(self.user, self.team)
def setUp(self): self.request_factory = RequestFactory() self.regular_user = new_user('regular_user') self.admin_user = new_user('admin_user', admin=True) self.contest = ContestFactory.from_dict({ 'name': 'Contest', 'code': 'contest', 'test_begin': past_time, 'test_end': future_time }).create() self.another_contest = ContestFactory.from_dict({ 'name': 'AnotherContest', 'code': 'another_contest' }).create() self.team = Team(contest=self.contest, name='team') self.team.save() self.another_team = Team(contest=self.another_contest, name='another_team') self.another_team.save()
def setUp(self): self.user = new_user('user') description = PostData.from_source('__description__', 'html') description.build_html() rules = PostData.from_source('__rules__', 'html') rules.build_html() ContestFactory.from_dict({ 'name': 'Contest', 'code': 'contest', 'description': description, 'rules': rules }).create()
def setUp(self): self.alice = new_user('alice') self.bob = new_user('bob') self.carol = new_user('carol') self.contest = ContestFactory.from_dict({ 'name': 'Contest', 'code': 'contest' }).create() self.another_contest = ContestFactory.from_dict({ 'name': 'AnotherContest', 'code': 'another_contest' }).create() self.team_a = Team(contest=self.contest, name='Team A') self.team_a.save() self.team_b = Team(contest=self.contest, name='Team B') self.team_b.save() self.another_contest_team = Team(contest=self.another_contest, name='another_team') self.another_contest_team.save() self.client = Client() self.client.force_login(self.alice)
def setUp(self): self.user = new_user('user') self.contest = ContestFactory.from_dict({ 'name': 'Contest', 'code': 'contest', 'verification_begin': past_time, 'verification_end': future_time, 'test_begin': past_time, 'test_end': past_time, 'scoring_script': ContentFile(script_always_42), 'answer_for_verification': ContentFile('meh') }).create() self.team = Team(contest=self.contest, name='Team') self.team.save() join_team(self.user, self.team)
def setUp(self): self.admin = new_user('admin', admin=True)
def setUp(self): self.user = new_user('user')