Commit 932a130b by cahrens

pep8/pylint

parent ec89d3da
...@@ -9,7 +9,7 @@ from django.test.client import Client ...@@ -9,7 +9,7 @@ from django.test.client import Client
from django.contrib.auth.models import User from django.contrib.auth.models import User
from xmodule.contentstore.django import contentstore from xmodule.contentstore.django import contentstore
from xmodule.modulestore import PublishState, ModuleStoreEnum, mongo from xmodule.modulestore import PublishState, ModuleStoreEnum
from xmodule.modulestore.inheritance import own_metadata from xmodule.modulestore.inheritance import own_metadata
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
......
...@@ -149,6 +149,7 @@ def course_image_url(course): ...@@ -149,6 +149,7 @@ def course_image_url(course):
path = loc.to_deprecated_string() path = loc.to_deprecated_string()
return path return path
# pylint: disable=invalid-name # pylint: disable=invalid-name
def is_currently_visible_to_students(xblock): def is_currently_visible_to_students(xblock):
""" """
......
...@@ -379,7 +379,7 @@ def course_index(request, course_key): ...@@ -379,7 +379,7 @@ def course_index(request, course_key):
current_action = CourseRerunState.objects.find_first(course_key=course_key, should_display=True) current_action = CourseRerunState.objects.find_first(course_key=course_key, should_display=True)
except (ItemNotFoundError, CourseActionStateItemNotFoundError): except (ItemNotFoundError, CourseActionStateItemNotFoundError):
current_action = None current_action = None
return render_to_response('course_outline.html', { return render_to_response('course_outline.html', {
'context_course': course_module, 'context_course': course_module,
'lms_link': lms_link, 'lms_link': lms_link,
......
...@@ -10,7 +10,6 @@ from contentstore.views.access import has_course_access ...@@ -10,7 +10,6 @@ from contentstore.views.access import has_course_access
from contentstore.views.course import course_outline_initial_state from contentstore.views.course import course_outline_initial_state
from contentstore.views.item import create_xblock_info, VisibilityState from contentstore.views.item import create_xblock_info, VisibilityState
from course_action_state.models import CourseRerunState from course_action_state.models import CourseRerunState
from contentstore.views.item import create_xblock_info
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from opaque_keys.edx.locator import CourseLocator from opaque_keys.edx.locator import CourseLocator
...@@ -273,4 +272,4 @@ class TestCourseOutline(CourseTestCase): ...@@ -273,4 +272,4 @@ class TestCourseOutline(CourseTestCase):
self.assertEqual(initial_state['locator_to_show'], chapter_locator) self.assertEqual(initial_state['locator_to_show'], chapter_locator)
expanded_locators = initial_state['expanded_locators'] expanded_locators = initial_state['expanded_locators']
self.assertIn(unicode(self.sequential.location), expanded_locators) self.assertIn(unicode(self.sequential.location), expanded_locators)
self.assertIn(unicode(self.vertical.location), expanded_locators) self.assertIn(unicode(self.vertical.location), expanded_locators)
\ No newline at end of file
...@@ -255,7 +255,6 @@ class DraftVersioningModuleStore(ModuleStoreDraftAndPublished, SplitMongoModuleS ...@@ -255,7 +255,6 @@ class DraftVersioningModuleStore(ModuleStoreDraftAndPublished, SplitMongoModuleS
PublishState.public - published exists and is the same as draft PublishState.public - published exists and is the same as draft
PublishState.private - no published version exists PublishState.private - no published version exists
""" """
# TODO figure out what to say if xblock is not from the HEAD of its branch
def get_head(branch): def get_head(branch):
course_structure = self._lookup_course(xblock.location.course_key.for_branch(branch))['structure'] course_structure = self._lookup_course(xblock.location.course_key.for_branch(branch))['structure']
return self._get_block_from_structure(course_structure, xblock.location.block_id) return self._get_block_from_structure(course_structure, xblock.location.block_id)
......
...@@ -875,7 +875,7 @@ class TestMixedModuleStore(unittest.TestCase): ...@@ -875,7 +875,7 @@ class TestMixedModuleStore(unittest.TestCase):
) )
self.assertEqual(self.user_id, block.edited_by) self.assertEqual(self.user_id, block.edited_by)
self.assertGreater(datetime.datetime.now(UTC), block.edited_on) self.assertGreater(datetime.datetime.now(UTC), block.edited_on)
@ddt.data('draft') @ddt.data('draft')
def test_create_item_populates_subtree_edited_info(self, default_ms): def test_create_item_populates_subtree_edited_info(self, default_ms):
self.initdb(default_ms) self.initdb(default_ms)
......
...@@ -247,7 +247,7 @@ class CourseOutlineUnit(CourseOutlineChild): ...@@ -247,7 +247,7 @@ class CourseOutlineUnit(CourseOutlineChild):
an initialized :class:`.ContainerPage` for that unit. an initialized :class:`.ContainerPage` for that unit.
""" """
return ContainerPage(self.browser, self.locator).visit() return ContainerPage(self.browser, self.locator).visit()
def is_browser_on_page(self): def is_browser_on_page(self):
return self.q(css=self.BODY_SELECTOR).present return self.q(css=self.BODY_SELECTOR).present
...@@ -356,13 +356,13 @@ class CourseOutlinePage(CoursePage, CourseOutlineContainer): ...@@ -356,13 +356,13 @@ class CourseOutlinePage(CoursePage, CourseOutlineContainer):
Return the :class:`.CourseOutlineSection` with the title `title`. Return the :class:`.CourseOutlineSection` with the title `title`.
""" """
return self.child(title) return self.child(title)
def section_at(self, index): def section_at(self, index):
""" """
Returns the :class:`.CourseOutlineSection` at the specified index. Returns the :class:`.CourseOutlineSection` at the specified index.
""" """
return self.child_at(index) return self.child_at(index)
def click_section_name(self, parent_css=''): def click_section_name(self, parent_css=''):
""" """
Find and click on first section name in course outline Find and click on first section name in course outline
...@@ -495,7 +495,7 @@ class CourseOutlineModal(object): ...@@ -495,7 +495,7 @@ class CourseOutlineModal(object):
self.click(input_selector) self.click(input_selector)
if getattr(self, property_name): if getattr(self, property_name):
current_month, current_year = map(int, getattr(self, property_name).split('/')[1:]) current_month, current_year = map(int, getattr(self, property_name).split('/')[1:])
else: # Use default timepicker values, which are current month and year. else: # Use default timepicker values, which are current month and year.
current_month, current_year = datetime.datetime.today().month, datetime.datetime.today().year current_month, current_year = datetime.datetime.today().month, datetime.datetime.today().year
date_diff = 12 * (year - current_year) + month - current_month date_diff = 12 * (year - current_year) + month - current_month
selector = "a.ui-datepicker-{}".format('next' if date_diff > 0 else 'prev') selector = "a.ui-datepicker-{}".format('next' if date_diff > 0 else 'prev')
......
...@@ -415,7 +415,7 @@ class UnitPublishingTest(ContainerBase): ...@@ -415,7 +415,7 @@ class UnitPublishingTest(ContainerBase):
XBlockFixtureDesc('problem', '<problem></problem>', data=self.html_content) XBlockFixtureDesc('problem', '<problem></problem>', data=self.html_content)
) )
) )
), ),
XBlockFixtureDesc('chapter', 'Section With Locked Unit').add_children( XBlockFixtureDesc('chapter', 'Section With Locked Unit').add_children(
XBlockFixtureDesc('sequential', 'Subsection With Locked Unit', XBlockFixtureDesc('sequential', 'Subsection With Locked Unit',
metadata={'start': past_start_date.isoformat()}).add_children( metadata={'start': past_start_date.isoformat()}).add_children(
......
...@@ -55,7 +55,7 @@ class WarningMessagesTest(CourseOutlineTest): ...@@ -55,7 +55,7 @@ class WarningMessagesTest(CourseOutlineTest):
""" """
Feature: Warning messages on sections, subsections, and units Feature: Warning messages on sections, subsections, and units
""" """
__test__ = True __test__ = True
STAFF_ONLY_WARNING = 'Contains staff only content' STAFF_ONLY_WARNING = 'Contains staff only content'
......
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