def i_am_registered_for_the_course(course, metadata): # Create the course create_course(course, metadata) # Create the user world.create_user('robot', 'test') usr = User.objects.get(username='******') # If the user is not already enrolled, enroll the user. CourseEnrollment.enroll(usr, course_id(course)) world.log_in(username='******', password='******')
def create_user_and_visit_course(): world.create_user('robot') u = User.objects.get(username='******') CourseEnrollment.objects.get_or_create(user=u, course_id=course_id("model_course")) world.log_in('robot', 'test') chapter_name = (TEST_SECTION_NAME + "1").replace(" ", "_") section_name = (TEST_SUBSECTION_NAME + "1").replace(" ", "_") url = django_url('/courses/edx/model_course/Test_Course/courseware/%s/%s' % (chapter_name, section_name)) world.browser.visit(url)
def i_am_staff_member_for_the_course(step, course_number): # Create the course create_course(step, course_number) course = get_course_by_id(course_id(course_number)) # Create the user world.create_user('robot', 'test') user = User.objects.get(username='******') # Add user as a course staff. allow_access(course, user, "staff") world.log_in(username='******', password='******')
def create_user_and_visit_course(): world.create_user('robot', 'test') u = User.objects.get(username='******') CourseEnrollment.enroll(u, course_id(world.scenario_dict['COURSE'].number)) world.log_in(username='******', password='******') chapter_name = (TEST_SECTION_NAME + "1").replace(" ", "_") section_name = (TEST_SUBSECTION_NAME + "1").replace(" ", "_") url = django_url('/courses/edx/model_course/Test_Course/courseware/%s/%s' % (chapter_name, section_name)) world.browser.visit(url)
def i_am_registered_for_the_course(step, course): # Create the course create_course(step, course) # Create the user world.create_user('robot') u = User.objects.get(username='******') # If the user is not already enrolled, enroll the user. # TODO: change to factory CourseEnrollment.objects.get_or_create(user=u, course_id=course_id(course)) world.log_in('robot', 'test')
def i_am_registered_for_the_course(step, course): # Create the course create_course(step, course) # Create the user world.create_user('robot', 'test') u = User.objects.get(username='******') # If the user is not already enrolled, enroll the user. # TODO: change to factory CourseEnrollment.enroll(u, course_id(course)) world.log_in(username='******', password='******')
def i_am_registered_for_the_course(course, metadata): # Create the course create_course(course, metadata) # Create the user world.create_user('robot', 'test') usr = User.objects.get(username='******') # If the user is not already enrolled, enroll the user. CourseEnrollment.enroll(usr, course_id(course)) world.add_to_course_staff('robot', world.scenario_dict['COURSE'].number) world.log_in(username='******', password='******')
def create_user_and_visit_course(): world.create_user('robot', 'test') u = User.objects.get(username='******') CourseEnrollment.objects.get_or_create(user=u, course_id=course_id(world.scenario_dict['COURSE'].number)) world.log_in(username='******', password='******') chapter_name = (TEST_SECTION_NAME + "1").replace(" ", "_") section_name = (TEST_SUBSECTION_NAME + "1").replace(" ", "_") url = django_url('/courses/edx/model_course/Test_Course/courseware/%s/%s' % (chapter_name, section_name)) world.browser.visit(url)
def i_am_logged_in_user(step): world.create_user('robot', 'test') world.log_in(username='******', password='******')
def registered_edx_user(step, uname): world.create_user(uname, 'test')
def i_am_an_edx_user(step): world.create_user('robot', 'test')
def i_am_logged_in(step): world.create_user('robot', 'test') world.log_in(username='******', password='******') world.browser.visit(django_url('/')) # You should not see the login link assert_equals(world.browser.find_by_css('a#login'), [])
def i_am_logged_in(step): world.create_user('robot', 'test') world.log_in(username='******', password='******') world.browser.visit(lettuce.django.django_url('/')) dash_css = '.container.dashboard' assert world.is_css_present(dash_css)
def i_am_logged_in_user(step): world.create_user('robot') world.log_in('robot', 'test')
def user_foo_is_enrolled_in_the_course(step, name): world.create_user(name, 'test') user = User.objects.get(username=name) course_id = world.scenario_dict['COURSE'].id CourseEnrollment.enroll(user, course_id)
def i_am_logged_in(step): world.create_user('robot', 'test') world.log_in(username='******', password='******') world.browser.visit(lettuce.django.django_url('/')) dash_css = '.dashboard' assert world.is_css_present(dash_css)
def user_foo_is_enrolled_in_the_course(step, name): world.create_user(name, 'test') user = User.objects.get(username=name) course_id = world.scenario_dict['COURSE'].location.course_id CourseEnrollment.enroll(user, course_id)
def i_am_logged_in(step): world.create_user('robot', 'test') world.log_in(username='******', password='******') world.browser.visit(django_url('/')) # You should not see the login link assert world.is_css_not_present('a#login')