コード例 #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()
コード例 #2
0
ファイル: test_views.py プロジェクト: cturra/mozilla-ignite
 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()
コード例 #4
0
ファイル: test_models.py プロジェクト: hfeeki/mozilla-ignite
 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()
コード例 #5
0
ファイル: test_views.py プロジェクト: hfeeki/mozilla-ignite
 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()
コード例 #6
0
ファイル: test_views.py プロジェクト: cturra/mozilla-ignite
 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()
コード例 #7
0
ファイル: test_views.py プロジェクト: cturra/mozilla-ignite
 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()
コード例 #8
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()
コード例 #9
0
ファイル: test_judging.py プロジェクト: cturra/mozilla-ignite
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())
コード例 #10
0
ファイル: test_views.py プロジェクト: cturra/mozilla-ignite
 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='******')
コード例 #11
0
ファイル: test_models.py プロジェクト: hfeeki/mozilla-ignite
 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]
     create_submissions(1, self.phase, self.created_by)
     self.submission_a = Submission.objects.get()
     self.parent = self.submission_a.parent
コード例 #13
0
ファイル: test_models.py プロジェクト: hfeeki/mozilla-ignite
 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)
コード例 #14
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())
 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)
コード例 #16
0
ファイル: test_views.py プロジェクト: hfeeki/mozilla-ignite
 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()
コード例 #17
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()
コード例 #18
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,
     }
コード例 #19
0
ファイル: test_views.py プロジェクト: hfeeki/mozilla-ignite
 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,
         }
コード例 #20
0
ファイル: test_models.py プロジェクト: hfeeki/mozilla-ignite
 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]
 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]