def navigate_to_an_openended_question_as_staff(step): world.register_by_course_key('MITx/3.091x/2012_Fall', True) world.log_in(email='*****@*****.**', password='******') problem = '/courses/MITx/3.091x/2012_Fall/courseware/Week_10/Polymer_Synthesis/' world.browser.visit(django_url(problem)) tab_css = 'ol#sequence-list > li > a[data-element="5"]' world.css_click(tab_css)
def make_populated_course(step): # pylint: disable=unused-argument ## This is different than the function defined in common.py because it enrolls ## a staff, instructor, and student member regardless of what `role` is, then ## logs `role` in. This is to ensure we have 3 class participants to email. # Clear existing courses to avoid conflicts world.clear_courses() # Create a new course course = world.CourseFactory.create(org="edx", number="888", display_name="Bulk Email Test Course") world.bulk_email_course_key = course.id try: # See if we've defined the instructor & staff user yet world.bulk_email_instructor except AttributeError: # Make & register an instructor for the course world.bulk_email_instructor = InstructorFactory(course_key=world.bulk_email_course_key) world.enroll_user(world.bulk_email_instructor, world.bulk_email_course_key) # Make & register a staff member world.bulk_email_staff = StaffFactory(course_key=course.id) world.enroll_user(world.bulk_email_staff, world.bulk_email_course_key) # Make & register a student world.register_by_course_key(course.id, username="******", password="******", is_staff=False) # Store the expected recipients # given each "send to" option staff_emails = [world.bulk_email_staff.email, world.bulk_email_instructor.email] world.expected_addresses = { "course staff": staff_emails, "students, staff, and instructors": staff_emails + ["*****@*****.**"], }
def make_populated_course(step): # pylint: disable=unused-argument ## This is different than the function defined in common.py because it enrolls ## a staff, instructor, and student member regardless of what `role` is, then ## logs `role` in. This is to ensure we have 3 class participants to email. # Clear existing courses to avoid conflicts world.clear_courses() # Create a new course course = world.CourseFactory.create(org='edx', number='888', display_name='Bulk Email Test Course') world.bulk_email_course_key = course.id try: # See if we've defined the instructor & staff user yet world.bulk_email_instructor except AttributeError: # Make & register an instructor for the course world.bulk_email_instructor = InstructorFactory( course_key=world.bulk_email_course_key) world.enroll_user(world.bulk_email_instructor, world.bulk_email_course_key) # Make & register a staff member world.bulk_email_staff = StaffFactory(course_key=course.id) world.enroll_user(world.bulk_email_staff, world.bulk_email_course_key) # Make & register a student world.register_by_course_key(course.id, username='******', password='******', is_staff=False) # Store the expected recipients # given each "send to" option staff_emails = [ world.bulk_email_staff.email, world.bulk_email_instructor.email ] world.expected_addresses = { 'course staff': staff_emails, 'students, staff, and instructors': staff_emails + ['*****@*****.**'] }
def i_am_staff_for_course_by_id(step, course_id): course_key = SlashSeparatedCourseKey.from_deprecated_string(course_id) world.register_by_course_key(course_key, True)
def i_am_staff_for_course_by_id(step, course_id): course_key = CourseKey.from_string(course_id) world.register_by_course_key(course_key, True)
def create_user_and_visit_course(): world.register_by_course_key(world.scenario_dict['COURSE'].id) world.log_in() world.visit(u'/courses/{}/courseware/'.format(world.scenario_dict['COURSE'].id))
def create_user_and_visit_course(): world.register_by_course_key(world.scenario_dict['COURSE'].id) world.log_in() world.visit(u'/courses/{}/courseware/'.format( world.scenario_dict['COURSE'].id))
def create_user_and_visit_course(): # TODO: this needs to update our mocked storage world.register_by_course_key(world.scenario_dict['COURSE'].id) world.log_in() world.visit(u'/courses/{}/courseware/'.format( world.scenario_dict['COURSE'].id))
def create_user_and_visit_course(): world.register_by_course_key(SlashSeparatedCourseKey('edx', '999', 'Test_Course')) world.log_in() world.visit('/courses/edx/999/Test_Course/courseware/')
def create_user_and_visit_course(): world.register_by_course_key( SlashSeparatedCourseKey('edx', '999', 'Test_Course')) world.log_in() world.visit('/courses/edx/999/Test_Course/courseware/')