def test_save_autoset_as_last_feedback_on_delivery_False(self): # Setup deliverybuilder = self.assignment1builder.add_group()\ .add_deadline_in_x_weeks(weeks=1)\ .add_delivery_x_hours_before_deadline(hours=1) feedback = StaticFeedback( delivery=deliverybuilder.delivery, points=10, grade='A', saved_by=self.testuser, is_passing_grade=True ) # Test self.assertIsNone(deliverybuilder.delivery.last_feedback) feedback.save(autoupdate_related_models=False) deliverybuilder.reload_from_db() self.assertIsNone(deliverybuilder.delivery.last_feedback)
def test_save_autoset_as_active_feedback_on_group(self): # Setup groupbuilder = self.assignment1builder.add_group() delivery = groupbuilder\ .add_deadline_in_x_weeks(weeks=1)\ .add_delivery_x_hours_before_deadline(hours=1).delivery feedback = StaticFeedback( delivery=delivery, points=10, grade='A', saved_by=self.testuser, is_passing_grade=True ) # Test self.assertIsNone(groupbuilder.group.feedback) feedback.save() groupbuilder.reload_from_db() self.assertEquals(groupbuilder.group.feedback, feedback)
def test_save_groupclose_False(self): # Setup groupbuilder = self.assignment1builder.add_group() delivery = groupbuilder\ .add_deadline_in_x_weeks(weeks=1)\ .add_delivery_x_hours_before_deadline(hours=1).delivery feedback = StaticFeedback( delivery=delivery, points=10, grade='A', saved_by=self.testuser, is_passing_grade=True ) # Test self.assertTrue(groupbuilder.group.is_open) feedback.save(autoupdate_related_models=False) groupbuilder.reload_from_db() self.assertTrue(groupbuilder.group.is_open)