Commit 874d7a02 by Sarina Canelake

Fix LTI acceptance tests

parent b406ba0f
...@@ -7,7 +7,7 @@ from lettuce import world, step ...@@ -7,7 +7,7 @@ from lettuce import world, step
from lettuce.django import django_url from lettuce.django import django_url
from common import course_id from common import course_id
from student.models import CourseEnrollment from courseware.tests.factories import InstructorFactory
@step('I view the LTI and error is shown$') @step('I view the LTI and error is shown$')
...@@ -195,15 +195,12 @@ def i_am_registered_for_the_course(course, metadata): ...@@ -195,15 +195,12 @@ def i_am_registered_for_the_course(course, metadata):
# Create the course # Create the course
create_course(course, metadata) create_course(course, metadata)
# Create the user # Create an instructor
world.create_user('robot', 'test') instructor = InstructorFactory(course=world.scenario_dict['COURSE'].location)
usr = User.objects.get(username='robot')
# If the user is not already enrolled, enroll the user. # Enroll the user in the course and log them in
CourseEnrollment.enroll(usr, course_id(course)) world.enroll_user(instructor, course_id(course))
world.log_in(username=instructor.username, password='test')
world.add_to_course_staff('robot', world.scenario_dict['COURSE'].number)
world.log_in(username='robot', password='test')
def check_lti_popup(): def check_lti_popup():
......
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