'Configures the course for this test.'

def set_up_course(self, enable_persistent_grades=True, create_multiple_subsections=False):

    self.course = CourseFactory.create(org='edx', name='course', run='run')
    if (not enable_persistent_grades):
        PersistentGradesEnabledFlag.objects.create(enabled=False)
    self.chapter = ItemFactory.create(parent=self.course, category='chapter', display_name='Chapter')
    self.sequential = ItemFactory.create(parent=self.chapter, category='sequential', display_name='Sequential1')
    self.problem = ItemFactory.create(parent=self.sequential, category='problem', display_name='Problem')
    if create_multiple_subsections:
        seq2 = ItemFactory.create(parent=self.chapter, category='sequential')
        ItemFactory.create(parent=seq2, category='problem')
    self.frozen_now_datetime = datetime.now().replace(tzinfo=pytz.UTC)
    self.frozen_now_timestamp = to_timestamp(self.frozen_now_datetime)
    self.problem_weighted_score_changed_kwargs = OrderedDict([('weighted_earned', 1.0), ('weighted_possible', 2.0), ('user_id', self.user.id), ('anonymous_user_id', 5), ('course_id', unicode(self.course.id)), ('usage_id', unicode(self.problem.location)), ('only_if_higher', None), ('modified', self.frozen_now_datetime), ('score_db_table', ScoreDatabaseTableEnum.courseware_student_module)])
    create_new_event_transaction_id()
    self.recalculate_subsection_grade_kwargs = OrderedDict([('user_id', self.user.id), ('course_id', unicode(self.course.id)), ('usage_id', unicode(self.problem.location)), ('anonymous_user_id', 5), ('only_if_higher', None), ('expected_modified_time', self.frozen_now_timestamp), ('score_deleted', False), ('event_transaction_id', unicode(get_event_transaction_id())), ('event_transaction_type', u'edx.grades.problem.submitted'), ('score_db_table', ScoreDatabaseTableEnum.courseware_student_module)])
    _ = anonymous_id_for_user(self.user, self.course.id)
