Commit 7229ef92 by Sarina Canelake

s/pylint: disable=W0212/pylint: disable=protected-access/

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