s/pylint: disable=W0212/pylint: disable=protected-access/
This commit is contained in:
@@ -54,7 +54,7 @@ class OptionInputTest(unittest.TestCase):
|
||||
'status': 'answered'}
|
||||
option_input = lookup_tag('optioninput')(test_capa_system(), element, state)
|
||||
|
||||
context = option_input._get_render_context() # pylint: disable=W0212
|
||||
context = option_input._get_render_context() # pylint: disable=protected-access
|
||||
|
||||
expected = {
|
||||
'STATIC_URL': '/dummy-static/',
|
||||
@@ -114,7 +114,7 @@ class ChoiceGroupTest(unittest.TestCase):
|
||||
|
||||
the_input = lookup_tag(tag)(test_capa_system(), element, state)
|
||||
|
||||
context = the_input._get_render_context() # pylint: disable=W0212
|
||||
context = the_input._get_render_context() # pylint: disable=protected-access
|
||||
|
||||
expected = {
|
||||
'STATIC_URL': '/dummy-static/',
|
||||
@@ -168,7 +168,7 @@ class JavascriptInputTest(unittest.TestCase):
|
||||
state = {'value': '3', }
|
||||
the_input = lookup_tag('javascriptinput')(test_capa_system(), element, state)
|
||||
|
||||
context = the_input._get_render_context() # pylint: disable=W0212
|
||||
context = the_input._get_render_context() # pylint: disable=protected-access
|
||||
|
||||
expected = {
|
||||
'STATIC_URL': '/dummy-static/',
|
||||
@@ -200,7 +200,7 @@ class TextLineTest(unittest.TestCase):
|
||||
state = {'value': 'BumbleBee', }
|
||||
the_input = lookup_tag('textline')(test_capa_system(), element, state)
|
||||
|
||||
context = the_input._get_render_context() # pylint: disable=W0212
|
||||
context = the_input._get_render_context() # pylint: disable=protected-access
|
||||
|
||||
expected = {
|
||||
'STATIC_URL': '/dummy-static/',
|
||||
@@ -232,7 +232,7 @@ class TextLineTest(unittest.TestCase):
|
||||
state = {'value': 'BumbleBee', }
|
||||
the_input = lookup_tag('textline')(test_capa_system(), element, state)
|
||||
|
||||
context = the_input._get_render_context() # pylint: disable=W0212
|
||||
context = the_input._get_render_context() # pylint: disable=protected-access
|
||||
|
||||
expected = {
|
||||
'STATIC_URL': '/dummy-static/',
|
||||
@@ -276,7 +276,7 @@ class TextLineTest(unittest.TestCase):
|
||||
state = {'value': 'BumbleBee', }
|
||||
the_input = lookup_tag('textline')(test_capa_system(), element, state)
|
||||
|
||||
context = the_input._get_render_context() # pylint: disable=W0212
|
||||
context = the_input._get_render_context() # pylint: disable=protected-access
|
||||
|
||||
expected = {
|
||||
'STATIC_URL': '/dummy-static/',
|
||||
@@ -318,7 +318,7 @@ class FileSubmissionTest(unittest.TestCase):
|
||||
input_class = lookup_tag('filesubmission')
|
||||
the_input = input_class(test_capa_system(), element, state)
|
||||
|
||||
context = the_input._get_render_context() # pylint: disable=W0212
|
||||
context = the_input._get_render_context() # pylint: disable=protected-access
|
||||
|
||||
expected = {
|
||||
'STATIC_URL': '/dummy-static/',
|
||||
@@ -367,7 +367,7 @@ class CodeInputTest(unittest.TestCase):
|
||||
input_class = lookup_tag('codeinput')
|
||||
the_input = input_class(test_capa_system(), element, state)
|
||||
|
||||
context = the_input._get_render_context() # pylint: disable=W0212
|
||||
context = the_input._get_render_context() # pylint: disable=protected-access
|
||||
|
||||
expected = {
|
||||
'STATIC_URL': '/dummy-static/',
|
||||
@@ -421,7 +421,7 @@ class MatlabTest(unittest.TestCase):
|
||||
self.the_input = self.input_class(test_capa_system(), elt, state)
|
||||
|
||||
def test_rendering(self):
|
||||
context = self.the_input._get_render_context() # pylint: disable=W0212
|
||||
context = self.the_input._get_render_context() # pylint: disable=protected-access
|
||||
|
||||
expected = {
|
||||
'STATIC_URL': '/dummy-static/',
|
||||
@@ -452,7 +452,7 @@ class MatlabTest(unittest.TestCase):
|
||||
elt = etree.fromstring(self.xml)
|
||||
|
||||
the_input = self.input_class(test_capa_system(), elt, state)
|
||||
context = the_input._get_render_context() # pylint: disable=W0212
|
||||
context = the_input._get_render_context() # pylint: disable=protected-access
|
||||
|
||||
expected = {
|
||||
'STATIC_URL': '/dummy-static/',
|
||||
@@ -484,7 +484,7 @@ class MatlabTest(unittest.TestCase):
|
||||
elt = etree.fromstring(self.xml)
|
||||
|
||||
the_input = self.input_class(test_capa_system(), elt, state)
|
||||
context = the_input._get_render_context() # pylint: disable=W0212
|
||||
context = the_input._get_render_context() # pylint: disable=protected-access
|
||||
expected = {
|
||||
'STATIC_URL': '/dummy-static/',
|
||||
'id': 'prob_1_2',
|
||||
@@ -515,7 +515,7 @@ class MatlabTest(unittest.TestCase):
|
||||
elt = etree.fromstring(self.xml)
|
||||
|
||||
the_input = self.input_class(test_capa_system(), elt, state)
|
||||
context = the_input._get_render_context() # pylint: disable=W0212
|
||||
context = the_input._get_render_context() # pylint: disable=protected-access
|
||||
expected = {
|
||||
'STATIC_URL': '/dummy-static/',
|
||||
'id': 'prob_1_2',
|
||||
@@ -721,7 +721,7 @@ class MatlabTest(unittest.TestCase):
|
||||
elt = etree.fromstring(self.xml)
|
||||
|
||||
the_input = self.input_class(test_capa_system(), elt, state)
|
||||
context = the_input._get_render_context() # pylint: disable=W0212
|
||||
context = the_input._get_render_context() # pylint: disable=protected-access
|
||||
self.maxDiff = None
|
||||
expected = fromstring(u'\n<div class="matlabResponse"><div class="commandWindowOutput" style="white-space: pre;"> <strong>if</strong> Conditionally execute statements.\nThe general form of the <strong>if</strong> statement is\n\n <strong>if</strong> expression\n statements\n ELSEIF expression\n statements\n ELSE\n statements\n END\n\nThe statements are executed if the real part of the expression \nhas all non-zero elements. The ELSE and ELSEIF parts are optional.\nZero or more ELSEIF parts can be used as well as nested <strong>if</strong>\'s.\nThe expression is usually of the form expr rop expr where \nrop is ==, <, >, <=, >=, or ~=.\n<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAjAAAAGkCAIAAACgj==">\n\nExample\n if I == J\n A(I,J) = 2;\n elseif abs(I-J) == 1\n A(I,J) = -1;\n else\n A(I,J) = 0;\n end\n\nSee also <a>relop</a>, <a>else</a>, <a>elseif</a>, <a>end</a>, <a>for</a>, <a>while</a>, <a>switch</a>.\n\nReference page in Help browser\n <a>doc if</a>\n\n</div><ul></ul></div>\n')
|
||||
received = fromstring(context['queue_msg'])
|
||||
@@ -792,7 +792,7 @@ class MatlabTest(unittest.TestCase):
|
||||
not_allowed_tag = 'script'
|
||||
self.the_input.msg = "<{0}>Test message</{0}>".format(not_allowed_tag)
|
||||
expected = "<script>Test message</script>"
|
||||
self.assertEqual(self.the_input._get_render_context()['msg'], expected)
|
||||
self.assertEqual(self.the_input._get_render_context()['msg'], expected) # pylint: disable=protected-access
|
||||
|
||||
|
||||
def html_tree_equal(received, expected):
|
||||
@@ -840,7 +840,7 @@ class SchematicTest(unittest.TestCase):
|
||||
|
||||
the_input = lookup_tag('schematic')(test_capa_system(), element, state)
|
||||
|
||||
context = the_input._get_render_context() # pylint: disable=W0212
|
||||
context = the_input._get_render_context() # pylint: disable=protected-access
|
||||
|
||||
expected = {
|
||||
'STATIC_URL': '/dummy-static/',
|
||||
@@ -884,7 +884,7 @@ class ImageInputTest(unittest.TestCase):
|
||||
|
||||
the_input = lookup_tag('imageinput')(test_capa_system(), element, state)
|
||||
|
||||
context = the_input._get_render_context() # pylint: disable=W0212
|
||||
context = the_input._get_render_context() # pylint: disable=protected-access
|
||||
|
||||
expected = {
|
||||
'STATIC_URL': '/dummy-static/',
|
||||
@@ -939,7 +939,7 @@ class CrystallographyTest(unittest.TestCase):
|
||||
|
||||
the_input = lookup_tag('crystallography')(test_capa_system(), element, state)
|
||||
|
||||
context = the_input._get_render_context() # pylint: disable=W0212
|
||||
context = the_input._get_render_context() # pylint: disable=protected-access
|
||||
|
||||
expected = {
|
||||
'STATIC_URL': '/dummy-static/',
|
||||
@@ -981,7 +981,7 @@ class VseprTest(unittest.TestCase):
|
||||
|
||||
the_input = lookup_tag('vsepr_input')(test_capa_system(), element, state)
|
||||
|
||||
context = the_input._get_render_context() # pylint: disable=W0212
|
||||
context = the_input._get_render_context() # pylint: disable=protected-access
|
||||
|
||||
expected = {
|
||||
'STATIC_URL': '/dummy-static/',
|
||||
@@ -1013,7 +1013,7 @@ class ChemicalEquationTest(unittest.TestCase):
|
||||
|
||||
def test_rendering(self):
|
||||
''' Verify that the render context matches the expected render context'''
|
||||
context = self.the_input._get_render_context() # pylint: disable=W0212
|
||||
context = self.the_input._get_render_context() # pylint: disable=protected-access
|
||||
|
||||
expected = {
|
||||
'STATIC_URL': '/dummy-static/',
|
||||
@@ -1101,7 +1101,7 @@ class FormulaEquationTest(unittest.TestCase):
|
||||
"""
|
||||
Verify that the render context matches the expected render context
|
||||
"""
|
||||
context = self.the_input._get_render_context() # pylint: disable=W0212
|
||||
context = self.the_input._get_render_context() # pylint: disable=protected-access
|
||||
|
||||
expected = {
|
||||
'STATIC_URL': '/dummy-static/',
|
||||
@@ -1231,7 +1231,7 @@ class DragAndDropTest(unittest.TestCase):
|
||||
|
||||
the_input = lookup_tag('drag_and_drop_input')(test_capa_system(), element, state)
|
||||
|
||||
context = the_input._get_render_context() # pylint: disable=W0212
|
||||
context = the_input._get_render_context() # pylint: disable=protected-access
|
||||
expected = {
|
||||
'STATIC_URL': '/dummy-static/',
|
||||
'id': 'prob_1_2',
|
||||
@@ -1283,7 +1283,7 @@ class AnnotationInputTest(unittest.TestCase):
|
||||
|
||||
the_input = lookup_tag(tag)(test_capa_system(), element, state)
|
||||
|
||||
context = the_input._get_render_context() # pylint: disable=W0212
|
||||
context = the_input._get_render_context() # pylint: disable=protected-access
|
||||
|
||||
expected = {
|
||||
'STATIC_URL': '/dummy-static/',
|
||||
@@ -1373,7 +1373,7 @@ class TestChoiceText(unittest.TestCase):
|
||||
}
|
||||
expected.update(state)
|
||||
the_input = lookup_tag(tag)(test_capa_system(), element, state)
|
||||
context = the_input._get_render_context() # pylint: disable=W0212
|
||||
context = the_input._get_render_context() # pylint: disable=protected-access
|
||||
self.assertEqual(context, expected)
|
||||
|
||||
def test_radiotextgroup(self):
|
||||
|
||||
Reference in New Issue
Block a user