Skip to content

Commit

Permalink
code quality fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cguardia authored and cewing committed Mar 31, 2015
1 parent 1aa38b3 commit b0e87cd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion common/lib/xmodule/xmodule/course_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ class CourseFields(object):
)


class CourseModule(CourseFields, SequenceModule):
class CourseModule(CourseFields, SequenceModule): # pylint: disable=abstract-method
"""
The CourseDescriptor needs its module_class to be a SequenceModule, but some code that
expects a CourseDescriptor to have all its fields can fail if it gets a SequenceModule instead.
Expand Down
9 changes: 6 additions & 3 deletions lms/djangoapps/ccx/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def tearDown(self):
"""
Undo patches.
"""
super(TestCoachDashboard, self).tearDown()
patch.stopall()

def test_not_a_coach(self):
Expand Down Expand Up @@ -419,11 +420,13 @@ def test_manage_remove_single_student(self):
)


original_get_children = XModuleMixin.get_children
GET_CHILDREN = XModuleMixin.get_children


def patched_get_children(self, usage_key_filter=None): # pylint: disable=missing-docstring
def iter_children(): # pylint: disable=missing-docstring
print self.__dict__
for child in original_get_children(self, usage_key_filter=usage_key_filter):
for child in GET_CHILDREN(self, usage_key_filter=usage_key_filter):
child._field_data_cache = {} # pylint: disable=protected-access
if not child.visible_to_staff_only:
yield child
Expand Down Expand Up @@ -492,7 +495,7 @@ def setUp(self):
for block in iter_blocks(course):
block._field_data = OverrideFieldData.wrap( # pylint: disable=protected-access
coach, block._field_data) # pylint: disable=protected-access
block._field_data_cache = {'tabs':[],'discussion_topics':[]} # pylint: disable=protected-access
block._field_data_cache = {'tabs': [], 'discussion_topics': []} # pylint: disable=protected-access

def cleanup_provider_classes():
"""
Expand Down
1 change: 1 addition & 0 deletions lms/djangoapps/courseware/tests/test_field_overrides.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def setUp(self):
OverrideFieldData.provider_classes = None

def tearDown(self):
super(OverrideFieldDataTests, self).tearDown()
OverrideFieldData.provider_classes = None

def make_one(self):
Expand Down
7 changes: 3 additions & 4 deletions lms/djangoapps/instructor/tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
from django.utils.timezone import utc
from django.test.utils import override_settings

from courseware.models import StudentModule
from courseware.field_overrides import OverrideFieldData
from student.tests.factories import UserFactory
from courseware.field_overrides import OverrideFieldData # pylint: disable=import-error
from student.tests.factories import UserFactory # pylint: disable=import-error
from xmodule.fields import Date
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
Expand Down Expand Up @@ -222,6 +221,7 @@ def setUp(self):
user, block._field_data) # pylint: disable=protected-access

def tearDown(self):
super(TestSetDueDateExtension, self).tearDown()
OverrideFieldData.provider_classes = None

def _clear_field_data_cache(self):
Expand Down Expand Up @@ -280,7 +280,6 @@ def setUp(self):
course = CourseFactory.create()
week1 = ItemFactory.create(due=due, parent=course)
week2 = ItemFactory.create(due=due, parent=course)
week3 = ItemFactory.create(due=due, parent=course)

homework = ItemFactory.create(
parent=week1,
Expand Down

0 comments on commit b0e87cd

Please sign in to comment.