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
c45d2ff9
Commit
c45d2ff9
authored
Sep 29, 2016
by
Oksana Slusarenro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test test_conditional_handles_polls
parent
cda7f1dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
common/test/acceptance/tests/lms/test_conditional.py
+8
-12
No files found.
common/test/acceptance/tests/lms/test_conditional.py
View file @
c45d2ff9
...
@@ -47,8 +47,9 @@ class ConditionalTest(UniqueCourseTest):
...
@@ -47,8 +47,9 @@ class ConditionalTest(UniqueCourseTest):
course_fixture
.
install
()
course_fixture
.
install
()
# Construct conditional block
# Construct conditional block
conditional_metadata
=
{}
source_block
=
None
source_block
=
None
conditional_attr
=
None
conditional_value
=
None
if
block_type
==
'problem'
:
if
block_type
==
'problem'
:
problem_factory
=
StringResponseXMLFactory
()
problem_factory
=
StringResponseXMLFactory
()
problem_xml
=
problem_factory
.
build_xml
(
problem_xml
=
problem_factory
.
build_xml
(
...
@@ -57,12 +58,9 @@ class ConditionalTest(UniqueCourseTest):
...
@@ -57,12 +58,9 @@ class ConditionalTest(UniqueCourseTest):
answer
=
'correct string'
,
answer
=
'correct string'
,
),
),
problem
=
XBlockFixtureDesc
(
'problem'
,
'Test Problem'
,
data
=
problem_xml
[
0
])
problem
=
XBlockFixtureDesc
(
'problem'
,
'Test Problem'
,
data
=
problem_xml
[
0
])
conditional_metadata
=
{
'xml_attributes'
:
{
'attempted'
:
'True'
}
}
source_block
=
problem
source_block
=
problem
conditional_attr
=
'attempted'
conditional_value
=
'True'
elif
block_type
==
'poll'
:
elif
block_type
==
'poll'
:
poll
=
XBlockFixtureDesc
(
poll
=
XBlockFixtureDesc
(
'poll_question'
,
'poll_question'
,
...
@@ -73,11 +71,8 @@ class ConditionalTest(UniqueCourseTest):
...
@@ -73,11 +71,8 @@ class ConditionalTest(UniqueCourseTest):
{
'id'
:
'no'
,
'text'
:
'Of course not!'
}
{
'id'
:
'no'
,
'text'
:
'Of course not!'
}
],
],
)
)
conditional_metadata
=
{
conditional_attr
=
'poll_answer'
'xml_attributes'
:
{
conditional_value
=
'yes'
'poll_answer'
:
'yes'
}
}
source_block
=
poll
source_block
=
poll
else
:
else
:
raise
NotImplementedError
()
raise
NotImplementedError
()
...
@@ -87,8 +82,9 @@ class ConditionalTest(UniqueCourseTest):
...
@@ -87,8 +82,9 @@ class ConditionalTest(UniqueCourseTest):
conditional
=
XBlockFixtureDesc
(
conditional
=
XBlockFixtureDesc
(
'conditional'
,
'conditional'
,
'Test Conditional'
,
'Test Conditional'
,
metadata
=
conditional_metadata
,
sources_list
=
[
source_block
.
locator
],
sources_list
=
[
source_block
.
locator
],
conditional_attr
=
conditional_attr
,
conditional_value
=
conditional_value
)
)
result_block
=
XBlockFixtureDesc
(
result_block
=
XBlockFixtureDesc
(
'html'
,
'Conditional Contents'
,
'html'
,
'Conditional Contents'
,
...
...
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