From 484e217de36b8e857418c324a592fd4ec54db628 Mon Sep 17 00:00:00 2001 From: JonahStanley Date: Thu, 27 Jun 2013 17:02:48 -0400 Subject: [PATCH] Fixed some errors --- cms/djangoapps/contentstore/features/common.py | 2 +- common/djangoapps/terrain/course_helpers.py | 4 ++-- lms/djangoapps/courseware/features/problems.py | 6 +++--- lms/djangoapps/courseware/features/video.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cms/djangoapps/contentstore/features/common.py b/cms/djangoapps/contentstore/features/common.py index dd115f76ef..438059cba3 100644 --- a/cms/djangoapps/contentstore/features/common.py +++ b/cms/djangoapps/contentstore/features/common.py @@ -156,7 +156,7 @@ def create_a_course(): # Add the user to the instructor group of the course # so they will have the permissions to see it in studio - course = world.GroupFactory.create(name='instructor_MITx/{course_num}/{course_name}'.format(course_num=world.scenario_dict['COURSE'].number, course_name=world.scenario_dict['COURSE_NAME'].display_name.replace(" ", "_"))) + course = world.GroupFactory.create(name='instructor_MITx/{course_num}/{course_name}'.format(course_num=world.scenario_dict['COURSE'].number, course_name=world.scenario_dict['COURSE'].display_name.replace(" ", "_"))) if world.scenario_dict['USER']: user = world.scenario_dict['USER'] else: diff --git a/common/djangoapps/terrain/course_helpers.py b/common/djangoapps/terrain/course_helpers.py index 3cb66e3bee..27bf95099d 100644 --- a/common/djangoapps/terrain/course_helpers.py +++ b/common/djangoapps/terrain/course_helpers.py @@ -44,7 +44,7 @@ def log_in(username, password): # Authenticate the user world.scenario_dict['USER'] = authenticate(username=username, password=password) - assert(user is not None and user.is_active) + assert(world.scenario_dict['USER'] is not None and world.scenario_dict['USER'].is_active) # Send a fake HttpRequest to log the user in # We need to process the request using @@ -53,7 +53,7 @@ def log_in(username, password): request = HttpRequest() SessionMiddleware().process_request(request) AuthenticationMiddleware().process_request(request) - login(request, user) + login(request, world.scenario_dict['USER']) # Save the session request.session.save() diff --git a/lms/djangoapps/courseware/features/problems.py b/lms/djangoapps/courseware/features/problems.py index bebbf655a2..82bb4959a8 100644 --- a/lms/djangoapps/courseware/features/problems.py +++ b/lms/djangoapps/courseware/features/problems.py @@ -21,7 +21,7 @@ def view_problem_with_attempts(step, problem_type, attempts): # Go to the one section in the factory-created course # which should be loaded with the correct problem - chapter_name = world.scenario_dict['SECTION_NAME'].replace(" ", "_") + chapter_name = world.scenario_dict['SECTION'].display_name.replace(" ", "_") section_name = chapter_name url = django_url('/courses/%s/%s/%s/courseware/%s/%s' % (world.scenario_dict['COURSE'].org, world.scenario_dict['COURSE'].number, world.scenario_dict['COURSE'].display_name.replace(' ', '_'), @@ -38,7 +38,7 @@ def view_problem_with_show_answer(step, problem_type, answer): # Go to the one section in the factory-created course # which should be loaded with the correct problem - chapter_name = world.scenario_dict['SECTION_NAME'].replace(" ", "_") + chapter_name = world.scenario_dict['SECTION'].display_name.replace(" ", "_") section_name = chapter_name url = django_url('/courses/%s/%s/%s/courseware/%s/%s' % (world.scenario_dict['COURSE'].org, world.scenario_dict['COURSE'].number, world.scenario_dict['COURSE'].display_name.replace(' ', '_'), @@ -55,7 +55,7 @@ def view_problem(step, problem_type): # Go to the one section in the factory-created course # which should be loaded with the correct problem - chapter_name = world.scenario_dict['SECTION_NAME'].replace(" ", "_") + chapter_name = world.scenario_dict['SECTION'].display_name.replace(" ", "_") section_name = chapter_name url = django_url('/courses/%s/%s/%s/courseware/%s/%s' % (world.scenario_dict['COURSE'].org, world.scenario_dict['COURSE'].number, world.scenario_dict['COURSE'].display_name.replace(' ', '_'), diff --git a/lms/djangoapps/courseware/features/video.py b/lms/djangoapps/courseware/features/video.py index 1be43f9dcb..6b05af51b5 100644 --- a/lms/djangoapps/courseware/features/video.py +++ b/lms/djangoapps/courseware/features/video.py @@ -19,7 +19,7 @@ def view_video(_step): # Make sure we have a video add_video_to_course(coursenum) - chapter_name = world.scenario_dict['SECTION_NAME'].replace(" ", "_") + chapter_name = world.scenario_dict['SECTION'].display_name.replace(" ", "_") section_name = chapter_name url = django_url('/courses/%s/%s/%s/courseware/%s/%s' % (world.scenario_dict['COURSE'].org, world.scenario_dict['COURSE'].number, world.scenario_dict['COURSE'].display_name.replace(' ', '_'), @@ -34,7 +34,7 @@ def view_videoalpha(step): # Make sure we have a videoalpha add_videoalpha_to_course(coursenum) - chapter_name = world.scenario_dict['SECTION_NAME'].replace(" ", "_") + chapter_name = world.scenario_dict['SECTION'].display_name.replace(" ", "_") section_name = chapter_name url = django_url('/courses/%s/%s/%s/courseware/%s/%s' % (world.scenario_dict['COURSE'].org, world.scenario_dict['COURSE'].number, world.scenario_dict['COURSE'].display_name.replace(' ', '_'),