コード例 #1
0
 def setUp(self):
     self.judge = create_user('bob')
     project = create_project('A project')
     challenge = create_challenge('A challenge', project)
     self.phase = create_phase('A phase', challenge)
     self.user = create_user('alex')
     self.submission = create_submission('A submission', self.user,
                                         self.phase)
     self.phase_award = Award.objects.create(phase=self.phase,
                                             amount=10000)
コード例 #2
0
 def setUp(self):
     # Ignite fixtures are setup on the BadgesBaseTest
     super(BadgesSubmissionTest, self).setUp()
     self.badge_a = self.create_badge()
     self.badge_b = self.create_badge(body="Award")
     self.user = create_user("bob")
     self.submission = create_submission("Hello", self.user, self.ideation)
 def setUp(self):
     # Ignite fixtures are setup on the BadgesBaseTest
     super(BadgesSubmissionTest, self).setUp()
     self.badge_a = self.create_badge()
     self.badge_b = self.create_badge(body='Award')
     self.user = create_user('bob')
     self.submission = create_submission('Hello', self.user, self.ideation)
 def create_submission_badge(self):
     """Creates a ``SubmissionBadge``"""
     data = {
         'badge_type': Badge.GREEN_LIT,
         'body': 'On the badge',
         }
     badge = Badge.objects.create(**data)
     bob = create_user('bob')
     submission = create_submission('Lorem Ipsum', bob, self.ideation)
     submission_badge = Submission.objects.create(badge=badge,
                                                  submission=submission)
     assert submission_badge.id, "Submission Badge creation failed"
     self.assertEqual(submission_badge.text, 'On the badge')
     submission_badge.body = 'Set on the submission'
     self.assertEqual(submission_badge.text, 'Set on the submission')