Adding bokchoy test and change in html file.
This commit is contained in:
@@ -298,11 +298,9 @@ class AboutPage(CoursePage):
|
||||
def is_browser_on_page(self):
|
||||
return self.q(css='.intro').present
|
||||
|
||||
|
||||
@property
|
||||
def is_register_button_present(self):
|
||||
"""
|
||||
Returns True if the timed/proctored exam timer bar is visible on the courseware.
|
||||
"""
|
||||
from nose.tools import set_trace; set_trace()
|
||||
return self.q(css=".register").is_present()
|
||||
|
||||
@@ -20,7 +20,6 @@ class DashboardPage(PageObject):
|
||||
super(DashboardPage, self).__init__(browser)
|
||||
url = BASE_URL + "/course/"
|
||||
|
||||
|
||||
def is_browser_on_page(self):
|
||||
return self.q(css='.content-primary').visible
|
||||
|
||||
@@ -62,7 +61,6 @@ class DashboardPage(PageObject):
|
||||
# Clicking on course with run will trigger an ajax event
|
||||
self.wait_for_ajax()
|
||||
|
||||
|
||||
def view_live(self, element):
|
||||
"""
|
||||
Clicks the "View Live" link and switches to the new tab
|
||||
|
||||
@@ -11,7 +11,6 @@ from ...pages.studio.overview import CourseOutlinePage
|
||||
from ...pages.studio.utils import verify_ordering
|
||||
|
||||
|
||||
|
||||
class StudioCourseTest(UniqueCourseTest):
|
||||
"""
|
||||
Base class for all Studio course tests.
|
||||
|
||||
@@ -179,6 +179,7 @@ class StudioLanguageTest(WebAppTest):
|
||||
u'Dummy Language (Esperanto)'
|
||||
)
|
||||
|
||||
|
||||
class CourseNotEnrollTest(WebAppTest):
|
||||
"""
|
||||
Test that we can create a new content library on the studio home page.
|
||||
@@ -204,11 +205,11 @@ class CourseNotEnrollTest(WebAppTest):
|
||||
# TODO - is there a better way to make this agnostic to the underlying default module store?
|
||||
default_store = os.environ.get('DEFAULT_STORE', 'draft')
|
||||
course_key = CourseLocator(
|
||||
self.course_org,
|
||||
self.course_number,
|
||||
self.course_run,
|
||||
deprecated=(default_store == 'draft')
|
||||
)
|
||||
self.course_org,
|
||||
self.course_number,
|
||||
self.course_run,
|
||||
deprecated=(default_store == 'draft')
|
||||
)
|
||||
return unicode(course_key)
|
||||
|
||||
def test_unenroll_course(self):
|
||||
@@ -235,17 +236,20 @@ class CourseNotEnrollTest(WebAppTest):
|
||||
self.assertTrue(self.dashboard_page.is_new_course_form_valid())
|
||||
self.dashboard_page.submit_new_course_form()
|
||||
|
||||
self.dashboard_page.visit()
|
||||
LogoutPage(self.browser).visit()
|
||||
AutoAuthPage(self.browser, course_id=None, staff=True).visit()
|
||||
|
||||
self.dashboard_page.visit()
|
||||
self.dashboard_page.view_live('.submit>input:last-child')
|
||||
|
||||
about_page = AboutPage(self.browser, self.course_id)
|
||||
about_page.wait_for_page()
|
||||
self.assertTrue(about_page.is_browser_on_page())
|
||||
self.assertTrue(about_page.is_register_button_present)
|
||||
|
||||
self.dashboard_page.visit()
|
||||
self.dashboard_page.view_live('.submit>input:first-child')
|
||||
courseware = CoursewarePage(self.browser, self.course_id)
|
||||
courseware.wait_for_page()
|
||||
self.assertTrue(courseware.is_browser_on_page())
|
||||
course_ware = CoursewarePage(self.browser, self.course_id)
|
||||
course_ware.wait_for_page()
|
||||
self.assertTrue(course_ware.is_browser_on_page())
|
||||
|
||||
@@ -1450,7 +1450,6 @@ class DefaultStatesContentTest(CourseOutlineTest):
|
||||
self.assertEqual(courseware.xblock_component_type(2), 'discussion')
|
||||
|
||||
def test_unenroll_course(self):
|
||||
from nose.tools import set_trace; set_trace()
|
||||
self.course_outline_page.visit()
|
||||
self.course_outline_page.view_live()
|
||||
courseware = CoursewarePage(self.browser, self.course_id)
|
||||
|
||||
@@ -222,6 +222,7 @@ class GeneratedCertificate(models.Model):
|
||||
MODES = Choices('verified', 'honor', 'audit', 'professional', 'no-id-professional')
|
||||
|
||||
VERIFIED_CERTS_MODES = [CourseMode.VERIFIED, CourseMode.CREDIT_MODE]
|
||||
|
||||
user = models.ForeignKey(User)
|
||||
course_id = CourseKeyField(max_length=255, blank=True, default=None)
|
||||
verify_uuid = models.CharField(max_length=32, blank=True, default='', db_index=True)
|
||||
|
||||
@@ -354,11 +354,11 @@ def _index_bulk_op(request, course_key, chapter, section, position):
|
||||
if not registered:
|
||||
# TODO (vshnayder): do course instructors need to be registered to see course?
|
||||
log.debug(u'User %s tried to view course %s but is not enrolled', user, course.location.to_deprecated_string())
|
||||
if bool(staff_access) == False:
|
||||
if not bool(staff_access):
|
||||
return redirect("{url}?{redirect}".format(
|
||||
url=reverse(enroll_staff, args=[course_key.to_deprecated_string()]),
|
||||
redirect=request.GET.urlencode()
|
||||
)
|
||||
)
|
||||
)
|
||||
return redirect(reverse('about_course', args=[course_key.to_deprecated_string()]))
|
||||
|
||||
@@ -838,6 +838,7 @@ def get_cosmetic_display_price(course, registration_price):
|
||||
# Translators: This refers to the cost of the course. In this case, the course costs nothing so it is free.
|
||||
return _('Free')
|
||||
|
||||
|
||||
@require_global_staff
|
||||
@require_http_methods(['POST', 'GET'])
|
||||
def enroll_staff(request, course_id):
|
||||
|
||||
Reference in New Issue
Block a user