Commit 484e217d by JonahStanley

Fixed some errors

parent 1f1bba55
...@@ -156,7 +156,7 @@ def create_a_course(): ...@@ -156,7 +156,7 @@ def create_a_course():
# Add the user to the instructor group of the course # Add the user to the instructor group of the course
# so they will have the permissions to see it in studio # 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']: if world.scenario_dict['USER']:
user = world.scenario_dict['USER'] user = world.scenario_dict['USER']
else: else:
......
...@@ -44,7 +44,7 @@ def log_in(username, password): ...@@ -44,7 +44,7 @@ def log_in(username, password):
# Authenticate the user # Authenticate the user
world.scenario_dict['USER'] = authenticate(username=username, password=password) 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 # Send a fake HttpRequest to log the user in
# We need to process the request using # We need to process the request using
...@@ -53,7 +53,7 @@ def log_in(username, password): ...@@ -53,7 +53,7 @@ def log_in(username, password):
request = HttpRequest() request = HttpRequest()
SessionMiddleware().process_request(request) SessionMiddleware().process_request(request)
AuthenticationMiddleware().process_request(request) AuthenticationMiddleware().process_request(request)
login(request, user) login(request, world.scenario_dict['USER'])
# Save the session # Save the session
request.session.save() request.session.save()
......
...@@ -21,7 +21,7 @@ def view_problem_with_attempts(step, problem_type, attempts): ...@@ -21,7 +21,7 @@ def view_problem_with_attempts(step, problem_type, attempts):
# Go to the one section in the factory-created course # Go to the one section in the factory-created course
# which should be loaded with the correct problem # 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 section_name = chapter_name
url = django_url('/courses/%s/%s/%s/courseware/%s/%s' % 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(' ', '_'), (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): ...@@ -38,7 +38,7 @@ def view_problem_with_show_answer(step, problem_type, answer):
# Go to the one section in the factory-created course # Go to the one section in the factory-created course
# which should be loaded with the correct problem # 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 section_name = chapter_name
url = django_url('/courses/%s/%s/%s/courseware/%s/%s' % 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(' ', '_'), (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): ...@@ -55,7 +55,7 @@ def view_problem(step, problem_type):
# Go to the one section in the factory-created course # Go to the one section in the factory-created course
# which should be loaded with the correct problem # 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 section_name = chapter_name
url = django_url('/courses/%s/%s/%s/courseware/%s/%s' % 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(' ', '_'), (world.scenario_dict['COURSE'].org, world.scenario_dict['COURSE'].number, world.scenario_dict['COURSE'].display_name.replace(' ', '_'),
......
...@@ -19,7 +19,7 @@ def view_video(_step): ...@@ -19,7 +19,7 @@ def view_video(_step):
# Make sure we have a video # Make sure we have a video
add_video_to_course(coursenum) 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 section_name = chapter_name
url = django_url('/courses/%s/%s/%s/courseware/%s/%s' % 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(' ', '_'), (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): ...@@ -34,7 +34,7 @@ def view_videoalpha(step):
# Make sure we have a videoalpha # Make sure we have a videoalpha
add_videoalpha_to_course(coursenum) 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 section_name = chapter_name
url = django_url('/courses/%s/%s/%s/courseware/%s/%s' % 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(' ', '_'), (world.scenario_dict['COURSE'].org, world.scenario_dict['COURSE'].number, world.scenario_dict['COURSE'].display_name.replace(' ', '_'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment