@@ -203,7 +203,7 @@ class CapaFactoryWithFiles(CapaFactory):
203203
204204@ddt .ddt
205205@skip_unless_lms
206- class ProblemBlockTest (unittest .TestCase ): # pylint: disable=too-many-public-methods
206+ class _ProblemBlockTestBase (unittest .TestCase ): # pylint: disable=too-many-public-methods
207207 """Tests for various problem types in XBlocks."""
208208
209209 def setUp (self ):
@@ -2843,8 +2843,18 @@ def test_problem_no_display_name(self, display_name, render_template):
28432843 assert context ["problem" ]["name" ] == block .location .block_type
28442844
28452845
2846+ @override_settings (USE_EXTRACTED_PROBLEM_BLOCK = True )
2847+ class ExtractedProblemBlockTestCase (_ProblemBlockTestBase ):
2848+ __test__ = True
2849+
2850+
2851+ @override_settings (USE_EXTRACTED_PROBLEM_BLOCK = False )
2852+ class BuiltInProblemBlockTestCase (_ProblemBlockTestBase ):
2853+ __test__ = True
2854+
2855+
28462856@ddt .ddt
2847- class ProblemBlockXMLTest (unittest .TestCase ):
2857+ class _ProblemBlockXMLTestBase (unittest .TestCase ):
28482858 """Tests XML strings for various problem types in XBlocks."""
28492859
28502860 sample_checkbox_problem_xml = textwrap .dedent (
@@ -3693,6 +3703,16 @@ def test_invalid_dropdown_xml(self):
36933703 CapaFactory .create (xml = problem_xml )
36943704
36953705
3706+ @override_settings (USE_EXTRACTED_PROBLEM_BLOCK = True )
3707+ class ExtractedProblemBlockXMLTestCase (_ProblemBlockXMLTestBase ):
3708+ __test__ = True
3709+
3710+
3711+ @override_settings (USE_EXTRACTED_PROBLEM_BLOCK = False )
3712+ class BuiltInProblemBlockXMLTestCase (_ProblemBlockXMLTestBase ):
3713+ __test__ = True
3714+
3715+
36963716class ComplexEncoderTest (unittest .TestCase ):
36973717 """Tests JSON encoding of complex numbers."""
36983718
@@ -3709,7 +3729,7 @@ def test_default(self):
37093729
37103730@skip_unless_lms
37113731@UseUnsafeCodejail ()
3712- class ProblemCheckTrackingTest (unittest .TestCase ):
3732+ class _ProblemCheckTrackingTestBase (unittest .TestCase ):
37133733 """
37143734 Ensure correct tracking information is included in events emitted during problem checks.
37153735 """
@@ -4045,7 +4065,17 @@ def test_get_answer_with_jump_to_id_urls(self):
40454065 assert problem .runtime .service (problem , "replace_urls" ).replace_urls .called
40464066
40474067
4048- class ProblemBlockReportGenerationTest (unittest .TestCase ):
4068+ @override_settings (USE_EXTRACTED_PROBLEM_BLOCK = True )
4069+ class ExtractedProblemCheckTrackingTestCase (_ProblemCheckTrackingTestBase ):
4070+ __test__ = True
4071+
4072+
4073+ @override_settings (USE_EXTRACTED_PROBLEM_BLOCK = False )
4074+ class BuiltInProblemCheckTrackingTestCase (_ProblemCheckTrackingTestBase ):
4075+ __test__ = True
4076+
4077+
4078+ class _ProblemBlockReportGenerationTestBase (unittest .TestCase ):
40494079 """
40504080 Ensure that Capa report generation works correctly
40514081 """
@@ -4140,3 +4170,13 @@ def test_generate_report_data_report_loncapa_error(self):
41404170 )
41414171 )
41424172 assert "Python Error: No Answer Retrieved" in list (report_data [0 ][1 ].values ())
4173+
4174+
4175+ @override_settings (USE_EXTRACTED_PROBLEM_BLOCK = True )
4176+ class ExtractedProblemBlockReportGenerationTestCase (_ProblemBlockReportGenerationTestBase ):
4177+ __test__ = True
4178+
4179+
4180+ @override_settings (USE_EXTRACTED_PROBLEM_BLOCK = False )
4181+ class BuiltInProblemBlockReportGenerationTestCase (_ProblemBlockReportGenerationTestBase ):
4182+ __test__ = True
0 commit comments