Ejemplo n.º 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='******')
Ejemplo n.º 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='******')
Ejemplo n.º 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)
Ejemplo n.º 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='******')
Ejemplo n.º 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)
Ejemplo n.º 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')
Ejemplo n.º 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='******')
Ejemplo n.º 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='******')
Ejemplo n.º 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)
Ejemplo n.º 10
0
def i_am_logged_in_user(step):
    world.create_user('robot', 'test')
    world.log_in(username='******', password='******')
Ejemplo n.º 11
0
def registered_edx_user(step, uname):
    world.create_user(uname, 'test')
Ejemplo n.º 12
0
def i_am_an_edx_user(step):
    world.create_user('robot', 'test')
Ejemplo n.º 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'), [])
Ejemplo n.º 14
0
def registered_edx_user(step, uname):
    world.create_user(uname, 'test')
Ejemplo n.º 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'), [])
Ejemplo n.º 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)
Ejemplo n.º 17
0
def i_am_logged_in_user(step):
    world.create_user('robot', 'test')
    world.log_in(username='******', password='******')
Ejemplo n.º 18
0
def i_am_logged_in_user(step):
    world.create_user('robot')
    world.log_in('robot', 'test')
Ejemplo n.º 19
0
def i_am_logged_in_user(step):
    world.create_user('robot')
    world.log_in('robot', 'test')
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 23
0
def i_am_an_edx_user(step):
    world.create_user('robot', 'test')
Ejemplo n.º 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')