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
c07ce2ad
Commit
c07ce2ad
authored
Apr 15, 2015
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify test_only_expected_fields_are_displayed
Use sets to accomplish the same result.
parent
04ca163f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
common/test/acceptance/tests/studio/test_studio_settings.py
+11
-4
No files found.
common/test/acceptance/tests/studio/test_studio_settings.py
View file @
c07ce2ad
...
@@ -397,10 +397,17 @@ class AdvancedSettingsValidationTest(StudioCourseTest):
...
@@ -397,10 +397,17 @@ class AdvancedSettingsValidationTest(StudioCourseTest):
When I view the Advanced Settings screen for the course
When I view the Advanced Settings screen for the course
The total number of fields displayed matches the number I expect
The total number of fields displayed matches the number I expect
And the actual fields displayed match the fields I expect to see
And the actual fields displayed match the fields I expect to see
Note that this test will NOT fail if fields that we expect to see are
not displayed, only if fields show up that we did not expect to see.
"""
"""
expected_fields
=
self
.
advanced_settings
.
expected_settings_names
expected_fields
=
self
.
advanced_settings
.
expected_settings_names
displayed_fields
=
self
.
advanced_settings
.
displayed_settings_names
displayed_fields
=
self
.
advanced_settings
.
displayed_settings_names
self
.
assertEqual
(
len
(
expected_fields
),
len
(
displayed_fields
))
unexpectedly_displayed
=
set
(
displayed_fields
)
-
set
(
expected_fields
)
for
field
in
displayed_fields
:
self
.
assertEquals
(
if
field
not
in
expected_fields
:
len
(
unexpectedly_displayed
),
self
.
fail
(
"Field '{}' not expected for Advanced Settings display."
.
format
(
field
))
0
,
"The following fields were unexpectedly displayed: {fields}"
.
format
(
fields
=
", "
.
join
(
unexpectedly_displayed
)
)
)
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