Exemplo n.º 1
0
 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()
Exemplo n.º 2
0
 def setUp(self):
     challenge_setup()
     user = User.objects.create_user('bob', '*****@*****.**', 'bob')
     create_submissions(1)
     
     self.phase = Phase.objects.get()
     self.submission = Submission.objects.get()
     self.judge = user.get_profile()
Exemplo n.º 3
0
 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()
        user = User.objects.create_user('bob', '*****@*****.**', 'bob')
        create_submissions(1)

        self.phase = Phase.objects.get()
        self.submission = Submission.objects.get()
        self.judge = user.get_profile()
Exemplo n.º 5
0
 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()
     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
Exemplo n.º 7
0
 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 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()
Exemplo n.º 10
0
 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()
Exemplo n.º 11
0
 def setUp(self):
     challenge_setup()
     self.phase = Phase.objects.all()[0]
     self.start_date = datetime.utcnow()
     self.end_date = self.phase.start_date + relativedelta(days=30)
     self.half_date = self.phase.start_date + relativedelta(days=15)
     self.delta = relativedelta(days=1)
     # specify start and end date of the Phase to something we
     # can refer to
     self.phase.start_date = self.start_date
     self.phase.end_date = self.end_date
     self.phase.save()
Exemplo n.º 12
0
 def setUp(self):
     challenge_setup()
     self.phase = Phase.objects.all()[0]
     self.start_date = datetime.utcnow()
     self.end_date = self.phase.start_date + relativedelta(days=30)
     self.half_date = self.phase.start_date + relativedelta(days=15)
     self.delta = relativedelta(days=1)
     # specify start and end date of the Phase to something we
     # can refer to
     self.phase.start_date = self.start_date
     self.phase.end_date = self.end_date
     self.phase.save()
Exemplo n.º 13
0
 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()
Exemplo n.º 14
0
 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()
Exemplo n.º 15
0
 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,
     }
Exemplo n.º 16
0
 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()
Exemplo n.º 17
0
 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,
         }
Exemplo n.º 18
0
 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()
Exemplo n.º 19
0
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())
Exemplo n.º 20
0
 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='******')
Exemplo n.º 21
0
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())
Exemplo n.º 22
0
 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()
Exemplo n.º 23
0
 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()
Exemplo n.º 24
0
 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]
Exemplo n.º 25
0
 def setUp(self):
     challenge_setup()
Exemplo n.º 26
0
 def setUp(self):
     challenge_setup()
     create_submissions(3)
     self.phase = Phase.objects.get()
     cache.clear()
Exemplo n.º 27
0
 def setUp(self):
     challenge_setup()
     create_submissions(3)
     cache.clear()
 def setUp(self):
     challenge_setup()
     cache.clear()
 def setUp(self):
     challenge_setup()
     create_submissions(3)
     self.phase = Phase.objects.get()
     cache.clear()
 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]