コード例 #1
0
ファイル: test_models.py プロジェクト: Nasmi1/devilry-django
 def test_get_last_feedbackdraft_feedback_workflow_does_not_allow_shared_feedback_drafts(self):
     FeedbackDraft.objects.create(
         delivery=self.deliverybuilder.delivery,
         feedbacktext_raw='Test',
         feedbacktext_html='<p>Test</p>',
         points=30,
         saved_by=UserBuilder('otheruser').user)
     self.assertEquals(
         FeedbackDraft.get_last_feedbackdraft(assignment=self.assignment1builder.assignment,
                                              delivery=self.deliverybuilder.delivery,
                                              user=self.testexaminer),
         None)
コード例 #2
0
ファイル: test_models.py プロジェクト: Nasmi1/devilry-django
 def test_get_last_feedbackdraft_owned(self):
     feedbackdraft = FeedbackDraft.objects.create(
         delivery=self.deliverybuilder.delivery,
         feedbacktext_raw='Test',
         feedbacktext_html='<p>Test</p>',
         points=30,
         saved_by=self.testexaminer)
     self.assertEquals(
         FeedbackDraft.get_last_feedbackdraft(assignment=self.assignment1builder.assignment,
                                              delivery=self.deliverybuilder.delivery,
                                              user=self.testexaminer),
         feedbackdraft)
コード例 #3
0
 def test_get_last_feedbackdraft_owned(self):
     feedbackdraft = FeedbackDraft.objects.create(
         delivery=self.deliverybuilder.delivery,
         feedbacktext_raw='Test',
         feedbacktext_html='<p>Test</p>',
         points=30,
         saved_by=self.testexaminer)
     self.assertEquals(
         FeedbackDraft.get_last_feedbackdraft(
             assignment=self.assignment1builder.assignment,
             delivery=self.deliverybuilder.delivery,
             user=self.testexaminer), feedbackdraft)
コード例 #4
0
 def test_get_last_feedbackdraft_feedback_workflow_does_not_allow_shared_feedback_drafts(
         self):
     FeedbackDraft.objects.create(delivery=self.deliverybuilder.delivery,
                                  feedbacktext_raw='Test',
                                  feedbacktext_html='<p>Test</p>',
                                  points=30,
                                  saved_by=UserBuilder('otheruser').user)
     self.assertEquals(
         FeedbackDraft.get_last_feedbackdraft(
             assignment=self.assignment1builder.assignment,
             delivery=self.deliverybuilder.delivery,
             user=self.testexaminer), None)
コード例 #5
0
ファイル: test_models.py プロジェクト: Nasmi1/devilry-django
 def test_get_last_feedbackdraft_feedback_workflow_allows_shared_feedback_drafts(self):
     self.assignment1builder.update(feedback_workflow='trusted-cooperative-feedback-editing')
     feedbackdraft = FeedbackDraft.objects.create(
         delivery=self.deliverybuilder.delivery,
         feedbacktext_raw='Test',
         feedbacktext_html='<p>Test</p>',
         points=30,
         saved_by=UserBuilder('otheruser').user)
     self.assertEquals(
         FeedbackDraft.get_last_feedbackdraft(assignment=self.assignment1builder.assignment,
                                              delivery=self.deliverybuilder.delivery,
                                              user=self.testexaminer),
         feedbackdraft)
コード例 #6
0
 def _setup_common_data(self):
     self.object = self.get_object()
     self.delivery = self.object
     self.assignment = self.delivery.deadline.assignment_group.assignment
     self.last_draft = FeedbackDraft.get_last_feedbackdraft(
         assignment=self.assignment,
         delivery=self.delivery,
         user=self.request.user)
     self.last_feedbackdraftfile = FeedbackDraftFile.objects\
         .filter_accessible_files(
             assignment=self.assignment,
             delivery=self.delivery,
             user=self.request.user)\
         .first()
コード例 #7
0
 def _setup_common_data(self):
     self.object = self.get_object()
     self.delivery = self.object
     self.assignment = self.delivery.deadline.assignment_group.assignment
     self.last_draft = FeedbackDraft.get_last_feedbackdraft(
         assignment=self.assignment,
         delivery=self.delivery,
         user=self.request.user)
     self.last_feedbackdraftfile = FeedbackDraftFile.objects\
         .filter_accessible_files(
             assignment=self.assignment,
             delivery=self.delivery,
             user=self.request.user)\
         .first()
コード例 #8
0
 def test_get_last_feedbackdraft_feedback_workflow_allows_shared_feedback_drafts(
         self):
     self.assignment1builder.update(
         feedback_workflow='trusted-cooperative-feedback-editing')
     feedbackdraft = FeedbackDraft.objects.create(
         delivery=self.deliverybuilder.delivery,
         feedbacktext_raw='Test',
         feedbacktext_html='<p>Test</p>',
         points=30,
         saved_by=UserBuilder('otheruser').user)
     self.assertEquals(
         FeedbackDraft.get_last_feedbackdraft(
             assignment=self.assignment1builder.assignment,
             delivery=self.deliverybuilder.delivery,
             user=self.testexaminer), feedbackdraft)
コード例 #9
0
ファイル: test_models.py プロジェクト: Nasmi1/devilry-django
 def test_get_last_feedbackdraft_none(self):
     self.assertEquals(
         FeedbackDraft.get_last_feedbackdraft(assignment=self.assignment1builder.assignment,
                                              delivery=self.deliverybuilder.delivery,
                                              user=self.testexaminer),
         None)
コード例 #10
0
 def test_get_last_feedbackdraft_none(self):
     self.assertEquals(
         FeedbackDraft.get_last_feedbackdraft(
             assignment=self.assignment1builder.assignment,
             delivery=self.deliverybuilder.delivery,
             user=self.testexaminer), None)