def setUp(self): challenge_setup() self.category_id = Category.objects.get().id self.project_slug, self.challenge_slug = (Project.objects.get().slug, Challenge.objects.get().slug) self.entry_form_path = '/en-US/%s/challenges/%s/entries/add/' % \ (self.project_slug, self.challenge_slug) create_users()
def setUp(self): challenge_setup() create_users() alex_profile = User.objects.get(username='******').get_profile() create_submissions(5, creator=alex_profile) self.draft_submission = Submission.objects.all()[0] self.draft_submission.is_draft = True self.draft_submission.save() cache.clear()
def setUp(self): challenge_setup() create_users() phase = Phase.objects.get() phase.name = 'Ideation' phase.save() self.alex_profile = User.objects.get(username='******').get_profile() submission = self.create_submission() self.parent = SubmissionParent.objects.create(submission=submission) base_kwargs = {'project': Project.objects.get().slug, 'slug': Challenge.objects.get().slug} self.view_path = submission.get_absolute_url() self.delete_path = submission.get_delete_url()
def setUp(self): challenge_setup() create_users() alex_profile = User.objects.get(username='******').get_profile() s = Submission.objects.create(phase=Phase.objects.get(), title='A submission', brief_description='My submission', description='My wonderful submission', created_by=alex_profile, category=Category.objects.get()) s.save() self.submission_path = s.get_absolute_url()
def setUp(self): challenge_setup() create_users() alex_profile = User.objects.get(username='******').get_profile() create_submissions(1, creator=alex_profile) submission = Submission.objects.get() base_kwargs = {'project': Project.objects.get().slug, 'slug': Challenge.objects.get().slug} self.view_path = submission.get_absolute_url() self.delete_path = submission.get_delete_url()
def setUp(self): challenge_setup() create_users() phase = Phase.objects.get() phase.name = 'Ideation' phase.save() self.alex_profile = User.objects.get(username='******').get_profile() submission = self.create_submission() self.parent = SubmissionParent.objects.create(submission=submission) base_kwargs = { 'project': Project.objects.get().slug, 'slug': Challenge.objects.get().slug } self.view_path = submission.get_absolute_url() self.delete_path = submission.get_delete_url()
def judging_setup(create_criteria=True, submission_count=1): challenge_setup() if create_criteria: questions = ["How %s is this idea?" % adjective for adjective in ["awesome", "sane", "badass"]] for question in questions: criterion = JudgingCriterion.objects.create(question=question) PhaseCriterion.objects.create(phase=Phase.objects.get(), criterion=criterion) create_users() submission_type = ContentType.objects.get_for_model(Submission) judge_permission, _ = Permission.objects.get_or_create(codename="judge_submission", content_type=submission_type) alex = User.objects.get(username="******") alex.user_permissions.add(judge_permission) create_submissions(submission_count, creator=alex.get_profile())
def setUp(self): challenge_setup() create_users() alex_profile = User.objects.get(username='******').get_profile() create_submissions(1, creator=alex_profile) submission = Submission.objects.get() self.view_path = submission.get_absolute_url() self.edit_path = submission.get_edit_url() ExternalLink.objects.create(submission=submission, name='Foo', url='http://example.com/') ExternalLink.objects.create(submission=submission, name='Foo', url='http://example.net/') self.client.login(username='******', password='******')
def setUp(self): challenge_setup() profile_list = create_users() self.phase = Phase.objects.all()[0] self.created_by = profile_list[0] self.category = Category.objects.all()[0] create_submissions(1, self.phase, self.created_by) self.submission_a = Submission.objects.get() self.parent = self.submission_a.parent
def setUp(self): challenge_setup() profile_list = create_users() self.phase = Phase.objects.all()[0] self.created_by = profile_list[0] self.category = Category.objects.all()[0] self.submission_a = self.create_submission(title='a') self.submission_b = self.create_submission(title='b') self.parent = SubmissionParent.objects.create(submission=self.submission_a)
def judging_setup(create_criteria=True, submission_count=1): challenge_setup() if create_criteria: questions = ['How %s is this idea?' % adjective for adjective in ['awesome', 'sane', 'badass']] for question in questions: criterion = JudgingCriterion.objects.create(question=question) PhaseCriterion.objects.create(phase=Phase.objects.get(), criterion=criterion) create_users() submission_type = ContentType.objects.get_for_model(Submission) judge_permission, _ = Permission.objects.get_or_create( codename='judge_submission', content_type=submission_type) alex = User.objects.get(username='******') alex.user_permissions.add(judge_permission) create_submissions(submission_count, creator=alex.get_profile())
def setUp(self): challenge_setup() profile_list = create_users() self.phase = Phase.objects.all()[0] self.created_by = profile_list[0] self.category = Category.objects.all()[0] self.submission_a = self.create_submission(title='a') self.submission_b = self.create_submission(title='b') self.parent = SubmissionParent.objects.create( submission=self.submission_a)
def setUp(self): challenge_setup() phase = Phase.objects.get() phase.name = 'Ideation' phase.save() create_users() admin = User.objects.create_user('admin', '*****@*****.**', password='******') admin.is_superuser = True admin.save() # Fill in the profile name to stop nag redirects admin_profile = admin.get_profile() admin_profile.name = 'Admin Adminson' admin_profile.save() alex_profile = User.objects.get(username='******').get_profile() create_submissions(1, creator=alex_profile) entry = Submission.objects.get() self.view_path = entry.get_absolute_url() self.edit_path = entry.get_edit_url()
def setUp(self): challenge_setup() profile_list = create_users() self.phase = Phase.objects.all()[0] self.alex = profile_list[0] self.category = Category.objects.all()[0] create_submissions(1, self.phase, self.alex) self.submission_a = Submission.objects.get() self.parent = self.submission_a.parent self.help_url = reverse('entry_help', args=[self.parent.slug]) self.valid_data = { 'notes': 'Help Wanted', 'status': SubmissionHelp.PUBLISHED, }
def setUp(self): challenge_setup() profile_list = create_users() self.phase = Phase.objects.all()[0] self.created_by = profile_list[0] self.category = Category.objects.all()[0]