Esempio n. 1
0
    def test_models_course_run_mark_dirty_update_to_be_scheduled_to(self):
        """
        Resetting a scheduled course run to a state "to be scheduled" should mark the related
        course page dirty.
        """
        course_run = CourseRunFactory()
        self.assertTrue(course_run.direct_course.extended_object.publish("en"))
        title_obj = course_run.direct_course.extended_object.title_set.first()

        course_run.start = None
        course_run.save()
        title_obj.refresh_from_db()

        self.assertEqual(title_obj.publisher_state, PUBLISHER_STATE_DIRTY)
Esempio n. 2
0
    def test_models_course_run_mark_dirty_update_to_be_scheduled_from(self):
        """
        Scheduling a course run that was to be scheduled should mark the related
        course page dirty.
        """
        now = timezone.now()
        course_run = CourseRunFactory(start=None, enrollment_start=now)
        self.assertTrue(course_run.direct_course.extended_object.publish("en"))
        title_obj = course_run.direct_course.extended_object.title_set.first()

        course_run.start = now
        course_run.save()
        title_obj.refresh_from_db()

        self.assertEqual(title_obj.publisher_state, PUBLISHER_STATE_DIRTY)