Example #1
0
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='******')
Example #2
0
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='******')
Example #3
0
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)
Example #4
0
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='******')
Example #5
0
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)
Example #6
0
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')
Example #7
0
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='******')
Example #8
0
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='******')
Example #9
0
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)
Example #10
0
def i_am_logged_in_user(step):
    world.create_user('robot', 'test')
    world.log_in(username='******', password='******')
Example #11
0
def registered_edx_user(step, uname):
    world.create_user(uname, 'test')
Example #12
0
def i_am_an_edx_user(step):
    world.create_user('robot', 'test')
Example #13
0
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'), [])
Example #14
0
def registered_edx_user(step, uname):
    world.create_user(uname, 'test')
Example #15
0
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'), [])
Example #16
0
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)
Example #17
0
def i_am_logged_in_user(step):
    world.create_user('robot', 'test')
    world.log_in(username='******', password='******')
Example #18
0
def i_am_logged_in_user(step):
    world.create_user('robot')
    world.log_in('robot', 'test')
Example #19
0
def i_am_logged_in_user(step):
    world.create_user('robot')
    world.log_in('robot', 'test')
Example #20
0
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)
Example #21
0
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)
Example #22
0
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)
Example #23
0
def i_am_an_edx_user(step):
    world.create_user('robot', 'test')
Example #24
0
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')