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)
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)
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)
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)
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)
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()
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)
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)
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)