Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
ce5c7948
Commit
ce5c7948
authored
Jan 21, 2015
by
Matt Drayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added field to FILTERED_LIST plus a new bokchoy test
parent
dce62ed6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
2 deletions
+91
-2
cms/djangoapps/models/settings/course_metadata.py
+4
-2
common/test/acceptance/pages/studio/settings_advanced.py
+71
-0
common/test/acceptance/tests/studio/test_studio_settings.py
+16
-0
No files found.
cms/djangoapps/models/settings/course_metadata.py
View file @
ce5c7948
...
...
@@ -15,8 +15,8 @@ class CourseMetadata(object):
editable metadata.
'''
# The list of fields that wouldn't be shown in Advanced Settings.
# Should not be used directly. Instead the filtered_list method should
be used if the field needs to be filtered
# depending on the feature flag.
# Should not be used directly. Instead the filtered_list method should
#
be used if the field needs to be filtered
depending on the feature flag.
FILTERED_LIST
=
[
'xml_attributes'
,
'start'
,
...
...
@@ -40,6 +40,8 @@ class CourseMetadata(object):
'entrance_exam_enabled'
,
'entrance_exam_minimum_score_pct'
,
'entrance_exam_id'
,
'is_entrance_exam'
,
'in_entrance_exam'
,
]
@classmethod
...
...
common/test/acceptance/pages/studio/settings_advanced.py
View file @
ce5c7948
...
...
@@ -13,6 +13,7 @@ MANUAL_BUTTON_SELECTOR = ".action-item .action-cancel"
MODAL_SELECTOR
=
".validation-error-modal-content"
ERROR_ITEM_NAME_SELECTOR
=
".error-item-title strong"
ERROR_ITEM_CONTENT_SELECTOR
=
".error-item-message"
SETTINGS_NAME_SELECTOR
=
".is-not-editable"
class
AdvancedSettingsPage
(
CoursePage
):
...
...
@@ -126,3 +127,73 @@ class AdvancedSettingsPage(CoursePage):
result_map
[
key
]
=
val
return
result_map
@property
def
displayed_settings_names
(
self
):
"""
Returns all settings displayed on the advanced settings page/screen/modal/whatever
We call it 'name', but it's really whatever is embedded in the 'id' element for each field
"""
query
=
self
.
q
(
css
=
SETTINGS_NAME_SELECTOR
)
return
query
.
attrs
(
'id'
)
@property
def
expected_settings_names
(
self
):
"""
Returns a list of settings expected to be displayed on the Advanced Settings screen
Should match the list of settings found in cms/djangoapps/models/settings/course_metadata.py
If a new setting is added to the metadata list, this test will fail and you must update it.
Basically this guards against accidental exposure of a field on the Advanced Settings screen
"""
return
[
'advanced_modules'
,
'allow_anonymous'
,
'allow_anonymous_to_peers'
,
'allow_public_wiki_access'
,
'cert_name_long'
,
'cert_name_short'
,
'certificates_display_behavior'
,
'cohort_config'
,
'course_image'
,
'advertised_start'
,
'announcement'
,
'display_name'
,
'info_sidebar_name'
,
'is_new'
,
'ispublic'
,
'max_student_enrollments_allowed'
,
'no_grade'
,
'display_coursenumber'
,
'display_organization'
,
'end_of_course_survey_url'
,
'catalog_visibility'
,
'chrome'
,
'days_early_for_beta'
,
'default_tab'
,
'disable_progress_graph'
,
'discussion_blackouts'
,
'discussion_sort_alpha'
,
'discussion_topics'
,
'due'
,
'due_date_display_format'
,
'use_latex_compiler'
,
'video_speed_optimizations'
,
'enrollment_domain'
,
'html_textbooks'
,
'invitation_only'
,
'lti_passports'
,
'matlab_api_key'
,
'max_attempts'
,
'mobile_available'
,
'rerandomize'
,
'remote_gradebook'
,
'annotation_token_secret'
,
'showanswer'
,
'show_calculator'
,
'show_chat'
,
'show_reset_button'
,
'static_asset_path'
,
'text_customization'
,
'annotation_storage_url'
,
'video_upload_pipeline'
]
common/test/acceptance/tests/studio/test_studio_settings.py
View file @
ce5c7948
...
...
@@ -290,3 +290,19 @@ class AdvancedSettingsValidationTest(StudioCourseTest):
"Course Announcement Date"
:
'"string"'
,
}
)
def
test_only_expected_fields_are_displayed
(
self
):
"""
Scenario: The Advanced Settings screen displays settings/fields not specifically hidden from
view by a developer.
Given I have a set of CourseMetadata fields defined for the course
When I view the Advanced Settings screen for the course
The total number of fields displayed matches the number I expect
And the actual fields displayed match the fields I expect to see
"""
expected_fields
=
self
.
advanced_settings
.
expected_settings_names
displayed_fields
=
self
.
advanced_settings
.
displayed_settings_names
self
.
assertEqual
(
len
(
expected_fields
),
len
(
displayed_fields
))
for
field
in
displayed_fields
:
if
field
not
in
expected_fields
:
self
.
fail
(
"Field '{}' not expected for Advanced Settings display."
.
format
(
field
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment