Remove ImageProblem related tests. This is a low value xblock.
This commit is contained in:
@@ -11,7 +11,6 @@ import ddt
|
||||
import pytest
|
||||
import six
|
||||
from bok_choy.promise import BrokenPromise
|
||||
from selenium.webdriver import ActionChains
|
||||
from six.moves import range
|
||||
|
||||
from capa.tests.response_xml_factory import (
|
||||
@@ -21,7 +20,6 @@ from capa.tests.response_xml_factory import (
|
||||
CodeResponseXMLFactory,
|
||||
CustomResponseXMLFactory,
|
||||
FormulaResponseXMLFactory,
|
||||
ImageResponseXMLFactory,
|
||||
JSInputXMLFactory,
|
||||
MultipleChoiceResponseXMLFactory,
|
||||
NumericalResponseXMLFactory,
|
||||
@@ -1989,79 +1987,6 @@ class CheckboxTextProblemTypeNeverShowCorrectnessTest(CheckboxTextProblemTypeBas
|
||||
pass
|
||||
|
||||
|
||||
class ImageProblemTypeBase(ProblemTypeTestBase):
|
||||
"""
|
||||
ProblemTypeTestBase specialization for Image Problem Type
|
||||
"""
|
||||
problem_name = 'IMAGE TEST PROBLEM'
|
||||
problem_type = 'image'
|
||||
partially_correct = False
|
||||
|
||||
factory = ImageResponseXMLFactory()
|
||||
|
||||
can_submit_blank = True
|
||||
can_update_save_notification = False
|
||||
|
||||
factory_kwargs = {
|
||||
'src': '/static/images/placeholder-image.png',
|
||||
'rectangle': '(0,0)-(50,50)',
|
||||
}
|
||||
|
||||
def answer_problem(self, correctness):
|
||||
"""
|
||||
Answer image problem.
|
||||
"""
|
||||
offset = 25 if correctness == 'correct' else -25
|
||||
input_selector = ".imageinput [id^='imageinput_'] img"
|
||||
input_element = self.problem_page.q(css=input_selector)[0]
|
||||
|
||||
chain = ActionChains(self.browser)
|
||||
chain.move_to_element(input_element)
|
||||
chain.move_by_offset(offset, offset)
|
||||
chain.click()
|
||||
chain.perform()
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
class ImageProblemTypeTest(ImageProblemTypeBase, ProblemTypeTestMixin):
|
||||
"""
|
||||
Standard tests for the Image Problem Type
|
||||
"""
|
||||
def test_image_problem_score_with_blank_answer(self):
|
||||
"""
|
||||
Scenario: I can see my score on a problem to which I submit a blank answer
|
||||
Given I am viewing aN image problem
|
||||
When I submit a problem
|
||||
Then I should see a score of Points Possible: 0/1 point (ungraded)
|
||||
"""
|
||||
self.problem_page.click_submit()
|
||||
self.assertEqual(self.problem_page.problem_progress_graded_value, '0/1 point (ungraded)')
|
||||
|
||||
|
||||
class ImageProblemTypeTestNonRandomized(ImageProblemTypeBase, NonRandomizedProblemTypeTestMixin):
|
||||
"""
|
||||
Tests for non-randomized Image problem
|
||||
"""
|
||||
def get_problem(self):
|
||||
"""
|
||||
Creates a {problem_type} problem
|
||||
"""
|
||||
# Generate the problem XML using capa.tests.response_xml_factory
|
||||
return XBlockFixtureDesc(
|
||||
'problem',
|
||||
self.problem_name,
|
||||
data=self.factory.build_xml(**self.factory_kwargs),
|
||||
metadata={'rerandomize': 'never', 'show_reset_button': True}
|
||||
)
|
||||
|
||||
|
||||
class ImageProblemTypeNeverShowCorrectnessTest(ImageProblemTypeBase, ProblemNeverShowCorrectnessMixin):
|
||||
"""
|
||||
Ensure that correctness can be withheld for Image Problem Type problems.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class SymbolicProblemTypeBase(ProblemTypeTestBase):
|
||||
"""
|
||||
ProblemTypeTestBase specialization for Symbolic Problem Type
|
||||
|
||||
Reference in New Issue
Block a user