Beispiel #1
0
 def test_judge_initial_allowance_non_gren_lit_submission(self):
     self.create_allowance()
     self.judge.user.is_judge = True
     # Mock the middleware that adds the is_judge flag
     context = get_award_context(self.submission, self.judge.user)
     self.assertFalse(context['award'])
     self.assertFalse(context['award_form'])
     assert context['allowance'], 'Missing Allowance'
Beispiel #2
0
 def test_judge_initial_allowance(self):
     self.submission.is_winner = True
     self.submission.save()
     self.create_allowance()
     self.judge.user.is_judge = True
     # Mock the middleware that adds the is_judge flag
     context = get_award_context(self.submission, self.judge.user)
     self.assertFalse(context['award'])
     assert context['award_form'], 'Missing Form'
     assert context['award_form']['amount'], 'Missing Field'
     assert context['allowance'], 'Missing Allowance'
Beispiel #3
0
 def test_judge_no_allowance_award_context(self):
     # Mock the middleware that adds the is_judge flag
     self.judge.user.is_judge = True
     context = get_award_context(self.submission, self.judge.user)
     self.assertFalse(context)
Beispiel #4
0
 def test_non_judge_award_context(self):
     # Mock the middleware that adds the is_judge flag
     self.user.user.is_judge = False
     context = get_award_context(self.submission, self.user.user)
     self.assertFalse(context)