Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
problem-builder
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
OpenEdx
problem-builder
Commits
b8050f28
Commit
b8050f28
authored
Jul 14, 2015
by
Tim Krones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix pep8 violations.
parent
f1e8f6a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
problem_builder/tests/integration/test_student_answers_dashboard.py
+6
-12
No files found.
problem_builder/tests/integration/test_student_answers_dashboard.py
View file @
b8050f28
...
@@ -56,7 +56,6 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
...
@@ -56,7 +56,6 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
data_export
=
self
.
go_to_view
()
data_export
=
self
.
go_to_view
()
self
.
assertIn
(
'This interface can only be used by course staff.'
,
data_export
.
text
)
self
.
assertIn
(
'This interface can only be used by course staff.'
,
data_export
.
text
)
@patch.dict
(
'sys.modules'
,
{
@patch.dict
(
'sys.modules'
,
{
'problem_builder.tasks'
:
MockTasksModule
(
successful
=
True
),
'problem_builder.tasks'
:
MockTasksModule
(
successful
=
True
),
'instructor_task'
:
True
,
'instructor_task'
:
True
,
...
@@ -95,7 +94,6 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
...
@@ -95,7 +94,6 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
self
.
assertIn
(
'Results retrieved on'
,
info_area
.
text
)
self
.
assertIn
(
'Results retrieved on'
,
info_area
.
text
)
self
.
assertEqual
(
''
,
status_area
.
text
)
self
.
assertEqual
(
''
,
status_area
.
text
)
@patch.dict
(
'sys.modules'
,
{
@patch.dict
(
'sys.modules'
,
{
'problem_builder.tasks'
:
MockTasksModule
(
successful
=
False
),
'problem_builder.tasks'
:
MockTasksModule
(
successful
=
False
),
'instructor_task'
:
True
,
'instructor_task'
:
True
,
...
@@ -128,7 +126,6 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
...
@@ -128,7 +126,6 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
self
.
assertEqual
(
''
,
info_area
.
text
)
self
.
assertEqual
(
''
,
info_area
.
text
)
self
.
assertIn
(
'Data export failed. Reason:'
,
status_area
.
text
)
self
.
assertIn
(
'Data export failed. Reason:'
,
status_area
.
text
)
@patch.dict
(
'sys.modules'
,
{
@patch.dict
(
'sys.modules'
,
{
'problem_builder.tasks'
:
MockTasksModule
(
successful
=
True
),
'problem_builder.tasks'
:
MockTasksModule
(
successful
=
True
),
'instructor_task'
:
True
,
'instructor_task'
:
True
,
...
@@ -158,7 +155,6 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
...
@@ -158,7 +155,6 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
self
.
assertEqual
(
'0'
,
current_page_info
.
text
)
self
.
assertEqual
(
'0'
,
current_page_info
.
text
)
self
.
assertEqual
(
'0'
,
total_pages_info
.
text
)
self
.
assertEqual
(
'0'
,
total_pages_info
.
text
)
@patch.dict
(
'sys.modules'
,
{
@patch.dict
(
'sys.modules'
,
{
'problem_builder.tasks'
:
MockTasksModule
(
'problem_builder.tasks'
:
MockTasksModule
(
successful
=
True
,
display_data
=
[[
successful
=
True
,
display_data
=
[[
...
@@ -198,7 +194,6 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
...
@@ -198,7 +194,6 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
self
.
assertEqual
(
'1'
,
current_page_info
.
text
)
self
.
assertEqual
(
'1'
,
current_page_info
.
text
)
self
.
assertEqual
(
'1'
,
total_pages_info
.
text
)
self
.
assertEqual
(
'1'
,
total_pages_info
.
text
)
@patch.dict
(
'sys.modules'
,
{
@patch.dict
(
'sys.modules'
,
{
'problem_builder.tasks'
:
MockTasksModule
(
'problem_builder.tasks'
:
MockTasksModule
(
successful
=
True
,
display_data
=
[[
successful
=
True
,
display_data
=
[[
...
@@ -243,7 +238,7 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
...
@@ -243,7 +238,7 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
# - "Next" button
# - "Next" button
next_page_button
.
click
()
# Navigate to second page
next_page_button
.
click
()
# Navigate to second page
self
.
assertTrue
(
first_page_button
.
is_enabled
())
self
.
assertTrue
(
first_page_button
.
is_enabled
())
self
.
assertTrue
(
prev_page_button
.
is_enabled
())
self
.
assertTrue
(
prev_page_button
.
is_enabled
())
...
@@ -252,7 +247,7 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
...
@@ -252,7 +247,7 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
self
.
assertEqual
(
'2'
,
current_page_info
.
text
)
self
.
assertEqual
(
'2'
,
current_page_info
.
text
)
next_page_button
.
click
()
# Navigate to third page
next_page_button
.
click
()
# Navigate to third page
self
.
assertTrue
(
first_page_button
.
is_enabled
())
self
.
assertTrue
(
first_page_button
.
is_enabled
())
self
.
assertTrue
(
prev_page_button
.
is_enabled
())
self
.
assertTrue
(
prev_page_button
.
is_enabled
())
...
@@ -263,7 +258,7 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
...
@@ -263,7 +258,7 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
# - "Prev" button
# - "Prev" button
prev_page_button
.
click
()
# Navigate to second page
prev_page_button
.
click
()
# Navigate to second page
self
.
assertTrue
(
first_page_button
.
is_enabled
())
self
.
assertTrue
(
first_page_button
.
is_enabled
())
self
.
assertTrue
(
prev_page_button
.
is_enabled
())
self
.
assertTrue
(
prev_page_button
.
is_enabled
())
...
@@ -272,7 +267,7 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
...
@@ -272,7 +267,7 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
self
.
assertEqual
(
'2'
,
current_page_info
.
text
)
self
.
assertEqual
(
'2'
,
current_page_info
.
text
)
prev_page_button
.
click
()
# Navigate to first page
prev_page_button
.
click
()
# Navigate to first page
self
.
assertFalse
(
first_page_button
.
is_enabled
())
self
.
assertFalse
(
first_page_button
.
is_enabled
())
self
.
assertFalse
(
prev_page_button
.
is_enabled
())
self
.
assertFalse
(
prev_page_button
.
is_enabled
())
...
@@ -283,7 +278,7 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
...
@@ -283,7 +278,7 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
# - "Last" button
# - "Last" button
last_page_button
.
click
()
# Navigate to last page
last_page_button
.
click
()
# Navigate to last page
self
.
assertTrue
(
first_page_button
.
is_enabled
())
self
.
assertTrue
(
first_page_button
.
is_enabled
())
self
.
assertTrue
(
prev_page_button
.
is_enabled
())
self
.
assertTrue
(
prev_page_button
.
is_enabled
())
...
@@ -294,7 +289,7 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
...
@@ -294,7 +289,7 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
# - "First" button
# - "First" button
first_page_button
.
click
()
# Navigate to first page
first_page_button
.
click
()
# Navigate to first page
self
.
assertFalse
(
first_page_button
.
is_enabled
())
self
.
assertFalse
(
first_page_button
.
is_enabled
())
self
.
assertFalse
(
prev_page_button
.
is_enabled
())
self
.
assertFalse
(
prev_page_button
.
is_enabled
())
...
@@ -303,7 +298,6 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
...
@@ -303,7 +298,6 @@ class StudentAnswersDashboardTest(SeleniumXBlockTest):
self
.
assertEqual
(
'1'
,
current_page_info
.
text
)
self
.
assertEqual
(
'1'
,
current_page_info
.
text
)
def
test_non_staff_disabled
(
self
):
def
test_non_staff_disabled
(
self
):
student_answers_dashboard
=
self
.
go_to_view
()
student_answers_dashboard
=
self
.
go_to_view
()
self
.
assertRaises
(
self
.
assertRaises
(
...
...
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