Adds in radio button patch request and text for page
EDUCATOR-229
This commit is contained in:
@@ -120,7 +120,7 @@ class CourseDiscussionSettingsTest(ModuleStoreTestCase):
|
||||
def test_invalid_data_types(self):
|
||||
exception_msg_template = "Incorrect field type for `{}`. Type must be `{}`"
|
||||
fields = [
|
||||
{'name': 'division_scheme', 'type': str},
|
||||
{'name': 'division_scheme', 'type': basestring},
|
||||
{'name': 'always_divide_inline_discussions', 'type': bool},
|
||||
{'name': 'divided_discussions', 'type': list}
|
||||
]
|
||||
|
||||
@@ -130,12 +130,13 @@ def set_course_discussion_settings(course_key, **kwargs):
|
||||
Returns:
|
||||
A CourseDiscussionSettings object.
|
||||
"""
|
||||
fields = {'division_scheme': str, 'always_divide_inline_discussions': bool, 'divided_discussions': list}
|
||||
fields = {'division_scheme': basestring, 'always_divide_inline_discussions': bool, 'divided_discussions': list}
|
||||
course_discussion_settings = get_course_discussion_settings(course_key)
|
||||
for field, field_type in fields.items():
|
||||
if field in kwargs:
|
||||
if not isinstance(kwargs[field], field_type):
|
||||
raise ValueError("Incorrect field type for `{}`. Type must be `{}`".format(field, field_type.__name__))
|
||||
setattr(course_discussion_settings, field, kwargs[field])
|
||||
course_discussion_settings.save()
|
||||
|
||||
course_discussion_settings.save()
|
||||
return course_discussion_settings
|
||||
|
||||
@@ -807,19 +807,19 @@ class DiscussionManagementSection(PageObject):
|
||||
Returns the ID of the selected discussion division scheme
|
||||
("NOT_DIVIDED_SCHEME", "COHORT_SCHEME", or "ENROLLMENT_TRACK_SCHEME)".
|
||||
"""
|
||||
return self.q(css=self._bounded_selector('.division-scheme:checked')).first.attrs('id')[0]
|
||||
return self.q(css=self._bounded_selector('.division-scheme:checked')).first.attrs('value')[0]
|
||||
|
||||
def select_division_scheme(self, scheme):
|
||||
"""
|
||||
Selects the radio button associated with the specified division scheme.
|
||||
"""
|
||||
self.q(css=self._bounded_selector("input#%s" % scheme)).first.click()
|
||||
self.q(css=self._bounded_selector("input.%s" % scheme)).first.click()
|
||||
|
||||
def division_scheme_visible(self, scheme):
|
||||
"""
|
||||
Returns whether or not the specified scheme is visible as an option.
|
||||
"""
|
||||
return self.q(css=self._bounded_selector("input#%s" % scheme)).visible
|
||||
return self.q(css=self._bounded_selector("input.%s" % scheme)).visible
|
||||
|
||||
|
||||
class MembershipPageAutoEnrollSection(PageObject):
|
||||
|
||||
@@ -99,7 +99,7 @@ class BaseDividedDiscussionTest(UniqueCourseTest, CohortTestMixin):
|
||||
Verify that the save confirmation message for the specified portion of the page is visible.
|
||||
"""
|
||||
confirmation_message = self.discussion_management_page.get_divide_discussions_message(key=key)
|
||||
self.assertEqual("Your changes have been saved.", confirmation_message)
|
||||
self.assertIn("Your changes have been saved.", confirmation_message)
|
||||
|
||||
|
||||
@attr(shard=6)
|
||||
|
||||
Reference in New Issue
Block a user