From c45d2ff942917a1c4c2d44f94f50179d2a965e8f Mon Sep 17 00:00:00 2001 From: Oksana Slusarenro Date: Thu, 29 Sep 2016 17:40:41 +0300 Subject: [PATCH] Fix test test_conditional_handles_polls --- .../acceptance/tests/lms/test_conditional.py | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/common/test/acceptance/tests/lms/test_conditional.py b/common/test/acceptance/tests/lms/test_conditional.py index 3b7cf2afe2..49dfba9462 100644 --- a/common/test/acceptance/tests/lms/test_conditional.py +++ b/common/test/acceptance/tests/lms/test_conditional.py @@ -47,8 +47,9 @@ class ConditionalTest(UniqueCourseTest): course_fixture.install() # Construct conditional block - conditional_metadata = {} source_block = None + conditional_attr = None + conditional_value = None if block_type == 'problem': problem_factory = StringResponseXMLFactory() problem_xml = problem_factory.build_xml( @@ -57,12 +58,9 @@ class ConditionalTest(UniqueCourseTest): answer='correct string', ), problem = XBlockFixtureDesc('problem', 'Test Problem', data=problem_xml[0]) - conditional_metadata = { - 'xml_attributes': { - 'attempted': 'True' - } - } source_block = problem + conditional_attr = 'attempted' + conditional_value = 'True' elif block_type == 'poll': poll = XBlockFixtureDesc( 'poll_question', @@ -73,11 +71,8 @@ class ConditionalTest(UniqueCourseTest): {'id': 'no', 'text': 'Of course not!'} ], ) - conditional_metadata = { - 'xml_attributes': { - 'poll_answer': 'yes' - } - } + conditional_attr = 'poll_answer' + conditional_value = 'yes' source_block = poll else: raise NotImplementedError() @@ -87,8 +82,9 @@ class ConditionalTest(UniqueCourseTest): conditional = XBlockFixtureDesc( 'conditional', 'Test Conditional', - metadata=conditional_metadata, sources_list=[source_block.locator], + conditional_attr=conditional_attr, + conditional_value=conditional_value ) result_block = XBlockFixtureDesc( 'html', 'Conditional Contents',