s/pylint: disable=W0212/pylint: disable=protected-access/
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# pylint: disable=W0212
|
||||
|
||||
import copy
|
||||
import mock
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Unit tests for the Mongo modulestore
|
||||
"""
|
||||
# pylint: disable=no-member
|
||||
# pylint: disable=W0212
|
||||
# pylint: disable=protected-access
|
||||
# pylint: disable=no-name-in-module
|
||||
from nose.tools import assert_equals, assert_raises, \
|
||||
assert_not_equals, assert_false, assert_true, assert_greater, assert_is_instance, assert_is_none
|
||||
|
||||
@@ -865,7 +865,7 @@ class SplitModuleItemTests(SplitModuleTest):
|
||||
with self.assertRaises(ItemNotFoundError):
|
||||
modulestore().get_item(locator)
|
||||
|
||||
# pylint: disable=W0212
|
||||
# pylint: disable=protected-access
|
||||
def test_matching(self):
|
||||
'''
|
||||
test the block and value matches help functions
|
||||
@@ -1304,7 +1304,7 @@ class TestItemCrud(SplitModuleTest):
|
||||
fields={'display_name': 'problem 2', 'data': another_payload},
|
||||
definition_locator=original.definition_locator,
|
||||
)
|
||||
# pylint: disable=W0212
|
||||
# pylint: disable=protected-access
|
||||
modulestore()._clear_cache()
|
||||
|
||||
# now begin the test
|
||||
|
||||
@@ -601,7 +601,7 @@ class CapaModuleTest(unittest.TestCase):
|
||||
|
||||
def test_check_problem_with_files(self):
|
||||
# Check a problem with uploaded files, using the check_problem API.
|
||||
# pylint: disable=W0212
|
||||
# pylint: disable=protected-access
|
||||
|
||||
# The files we'll be uploading.
|
||||
fnames = ["prog1.py", "prog2.py", "prog3.py"]
|
||||
@@ -650,7 +650,7 @@ class CapaModuleTest(unittest.TestCase):
|
||||
|
||||
def test_check_problem_with_files_as_xblock(self):
|
||||
# Check a problem with uploaded files, using the XBlock API.
|
||||
# pylint: disable=W0212
|
||||
# pylint: disable=protected-access
|
||||
|
||||
# The files we'll be uploading.
|
||||
fnames = ["prog1.py", "prog2.py", "prog3.py"]
|
||||
|
||||
@@ -206,7 +206,7 @@ class ImportTestCase(BaseCourseTestCase):
|
||||
descriptor = system.process_xml(start_xml)
|
||||
compute_inherited_metadata(descriptor)
|
||||
|
||||
# pylint: disable=W0212
|
||||
# pylint: disable=protected-access
|
||||
print(descriptor, descriptor._field_data)
|
||||
self.assertEqual(descriptor.due, ImportTestCase.date.from_json(v))
|
||||
|
||||
@@ -296,7 +296,7 @@ class ImportTestCase(BaseCourseTestCase):
|
||||
</course>'''.format(due=course_due, org=ORG, course=COURSE, url_name=url_name)
|
||||
descriptor = system.process_xml(start_xml)
|
||||
child = descriptor.get_children()[0]
|
||||
# pylint: disable=W0212
|
||||
# pylint: disable=protected-access
|
||||
child._field_data.set(child, 'due', child_due)
|
||||
compute_inherited_metadata(descriptor)
|
||||
|
||||
|
||||
@@ -60,12 +60,12 @@ class TextAnnotationModuleTestCase(unittest.TestCase):
|
||||
xmltree = etree.fromstring(self.sample_xml)
|
||||
|
||||
expected_xml = u"<div><p>Test Instructions.</p></div>"
|
||||
actual_xml = self.mod._extract_instructions(xmltree) # pylint: disable=W0212
|
||||
actual_xml = self.mod._extract_instructions(xmltree) # pylint: disable=protected-access
|
||||
self.assertIsNotNone(actual_xml)
|
||||
self.assertEqual(expected_xml.strip(), actual_xml.strip())
|
||||
|
||||
xmltree = etree.fromstring('<annotatable>foo</annotatable>')
|
||||
actual = self.mod._extract_instructions(xmltree) # pylint: disable=W0212
|
||||
actual = self.mod._extract_instructions(xmltree) # pylint: disable=protected-access
|
||||
self.assertIsNone(actual)
|
||||
|
||||
def test_student_view(self):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# pylint: disable=W0212
|
||||
# pylint: disable=protected-access
|
||||
"""Test for Video Xmodule functional logic.
|
||||
These test data read from xml, not from mongo.
|
||||
|
||||
|
||||
@@ -56,12 +56,12 @@ class VideoAnnotationModuleTestCase(unittest.TestCase):
|
||||
xmltree = etree.fromstring(self.sample_xml)
|
||||
|
||||
expected_xml = u"<div><p>Video Test Instructions.</p></div>"
|
||||
actual_xml = self.mod._extract_instructions(xmltree) # pylint: disable=W0212
|
||||
actual_xml = self.mod._extract_instructions(xmltree) # pylint: disable=protected-access
|
||||
self.assertIsNotNone(actual_xml)
|
||||
self.assertEqual(expected_xml.strip(), actual_xml.strip())
|
||||
|
||||
xmltree = etree.fromstring('<annotatable>foo</annotatable>')
|
||||
actual = self.mod._extract_instructions(xmltree) # pylint: disable=W0212
|
||||
actual = self.mod._extract_instructions(xmltree) # pylint: disable=protected-access
|
||||
self.assertIsNone(actual)
|
||||
|
||||
def test_get_extension(self):
|
||||
@@ -71,8 +71,8 @@ class VideoAnnotationModuleTestCase(unittest.TestCase):
|
||||
"""
|
||||
expectedyoutube = 'video/youtube'
|
||||
expectednotyoutube = 'video/mp4'
|
||||
result1 = self.mod._get_extension(self.sample_sourceurl) # pylint: disable=W0212
|
||||
result2 = self.mod._get_extension(self.sample_youtubeurl) # pylint: disable=W0212
|
||||
result1 = self.mod._get_extension(self.sample_sourceurl) # pylint: disable=protected-access
|
||||
result2 = self.mod._get_extension(self.sample_youtubeurl) # pylint: disable=protected-access
|
||||
self.assertEqual(expectedyoutube, result2)
|
||||
self.assertEqual(expectednotyoutube, result1)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# pylint: disable=invalid-name
|
||||
# pylint: disable=W0622
|
||||
# pylint: disable=W0212
|
||||
# pylint: disable=protected-access
|
||||
# pylint: disable=unused-argument
|
||||
|
||||
import os
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# pylint: disable=invalid-name
|
||||
# pylint: disable=W0622
|
||||
# pylint: disable=W0212
|
||||
# pylint: disable=protected-access
|
||||
# pylint: disable=unused-argument
|
||||
|
||||
import os
|
||||
|
||||
@@ -98,5 +98,5 @@ class WikiAccessMiddleware(object):
|
||||
response = self._redirect_from_referrer(request, wiki_path) or response
|
||||
|
||||
# END HACK: _transform_url must be set to a no-op function after it's done its work
|
||||
reverse._transform_url = lambda url: url # pylint: disable=W0212
|
||||
reverse._transform_url = lambda url: url # pylint: disable=protected-access
|
||||
return response
|
||||
|
||||
@@ -16,7 +16,7 @@ from xmodule.course_module import (
|
||||
CATALOG_VISIBILITY_NONE)
|
||||
|
||||
# pylint: disable=missing-docstring
|
||||
# pylint: disable=W0212
|
||||
# pylint: disable=protected-access
|
||||
|
||||
|
||||
class AccessTestCase(TestCase):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# pylint: disable=W0212
|
||||
# pylint: disable=protected-access
|
||||
|
||||
"""Test for Video Xmodule functional logic.
|
||||
These test data read from xml, not from mongo.
|
||||
|
||||
@@ -22,7 +22,7 @@ class SoftDeleteCouponAdmin(admin.ModelAdmin):
|
||||
admin site. This is used by changelist_view. """
|
||||
# Default: qs = self.model._default_manager.get_active_coupons_query_set()
|
||||
# Queryset with all the coupons including the soft-deletes: qs = self.model._default_manager.get_query_set()
|
||||
query_string = self.model._default_manager.get_active_coupons_query_set() # pylint: disable=W0212
|
||||
query_string = self.model._default_manager.get_active_coupons_query_set() # pylint: disable=protected-access
|
||||
return query_string
|
||||
|
||||
def get_actions(self, request):
|
||||
|
||||
Reference in New Issue
Block a user