コード例 #1
0
ファイル: test_models.py プロジェクト: akatsoulas/oneanddone
 def test_feedback_display_text(self):
     """
     If feedback exists for an attempt, return the feedback text.
     """
     feedback_text = 'Feedback text'
     FeedbackFactory.create(attempt=self.attempt, text=feedback_text)
     eq_(self.attempt.feedback_display, feedback_text)
コード例 #2
0
 def test_feedback_display_text(self):
     """
     If feedback exists for an attempt, return the feedback text.
     """
     feedback_text = 'Feedback text'
     FeedbackFactory.create(attempt=self.attempt, text=feedback_text)
     eq_(self.attempt.feedback_display, feedback_text)
コード例 #3
0
ファイル: test_mixins.py プロジェクト: VarnaSuresh/oneanddone
    def test_attempt_with_feedback_raises_404(self):
        """
        If the current user has an attempt but feedback has already been
        provided, return a 404.
        """
        user = UserFactory.create()
        attempt = TaskAttemptFactory.create(user=user, state=TaskAttempt.FINISHED)
        FeedbackFactory.create(attempt=attempt)
        request = Mock(user=UserFactory.create())

        with self.assertRaises(Http404):
            self.view.dispatch(request, pk=attempt.pk)
コード例 #4
0
    def test_attempt_with_feedback_raises_404(self):
        """
        If the current user has an attempt but feedback has already been
        provided, return a 404.
        """
        user = UserFactory.create()
        attempt = TaskAttemptFactory.create(user=user,
                                            state=TaskAttempt.FINISHED)
        FeedbackFactory.create(attempt=attempt)
        request = Mock(user=UserFactory.create())

        with self.assertRaises(Http404):
            self.view.dispatch(request, pk=attempt.pk)
コード例 #5
0
ファイル: test_models.py プロジェクト: akatsoulas/oneanddone
 def test_has_feedback_true(self):
     """
     If feedback exists return True.
     """
     FeedbackFactory.create(attempt=self.attempt)
     eq_(self.attempt.has_feedback, True)
コード例 #6
0
 def test_has_feedback_true(self):
     """
     If feedback exists return True.
     """
     FeedbackFactory.create(attempt=self.attempt)
     eq_(self.attempt.has_feedback, True)