This commit updates lms/djangoapps/courseware. These keys are now objects with a limited interface, and the particular internal representation is managed by the data storage layer (the modulestore). For the LMS, there should be no outward-facing changes to the system. The keys are, for now, a change to internal representation only. For Studio, the new serialized form of the keys is used in urls, to allow for further migration in the future. Co-Author: Andy Armstrong <andya@edx.org> Co-Author: Christina Roberts <christina@edx.org> Co-Author: David Baumgold <db@edx.org> Co-Author: Diana Huang <dkh@edx.org> Co-Author: Don Mitchell <dmitchell@edx.org> Co-Author: Julia Hansbrough <julia@edx.org> Co-Author: Nimisha Asthagiri <nasthagiri@edx.org> Co-Author: Sarina Canelake <sarina@edx.org> [LMS-2370]
38 lines
1.3 KiB
Python
38 lines
1.3 KiB
Python
# pylint: disable=C0111
|
|
# pylint: disable=W0621
|
|
|
|
from lettuce import world, step
|
|
from lettuce.django import django_url
|
|
|
|
|
|
@step('I register for the course "([^"]*)"$')
|
|
def i_register_for_the_course(_step, course):
|
|
url = django_url('courses/%s/about' % world.scenario_dict['COURSE'].id.to_deprecated_string())
|
|
world.browser.visit(url)
|
|
world.css_click('section.intro a.register')
|
|
|
|
assert world.is_css_present('section.container.dashboard')
|
|
|
|
|
|
@step(u'I should see an empty dashboard message')
|
|
def i_should_see_empty_dashboard(_step):
|
|
empty_dash_css = 'section.empty-dashboard-message'
|
|
assert world.is_css_present(empty_dash_css)
|
|
|
|
|
|
@step(u'I should( NOT)? see the course numbered "([^"]*)" in my dashboard$')
|
|
def i_should_see_that_course_in_my_dashboard(_step, doesnt_appear, course):
|
|
course_link_css = 'section.my-courses a[href*="%s"]' % course
|
|
if doesnt_appear:
|
|
assert world.is_css_not_present(course_link_css)
|
|
else:
|
|
assert world.is_css_present(course_link_css)
|
|
|
|
|
|
@step(u'I unregister for the course numbered "([^"]*)"')
|
|
def i_unregister_for_that_course(_step, course):
|
|
unregister_css = 'section.info a[href*="#unenroll-modal"][data-course-number*="%s"]' % course
|
|
world.css_click(unregister_css)
|
|
button_css = 'section#unenroll-modal input[value="Unregister"]'
|
|
world.css_click(button_css)
|