Commit b63aae22 by Jay Zoldak

small pep8 pylint and superclass fixes

parent 5bf839c9
...@@ -32,7 +32,7 @@ class ModuleStoreTestCase(TestCase): ...@@ -32,7 +32,7 @@ class ModuleStoreTestCase(TestCase):
# This query means: every item in the collection # This query means: every item in the collection
# that is not a template # that is not a template
query = { "_id.course": { "$ne": "templates" }} query = {"_id.course": {"$ne": "templates"}}
# Remove everything except templates # Remove everything except templates
modulestore.collection.remove(query) modulestore.collection.remove(query)
...@@ -47,7 +47,7 @@ class ModuleStoreTestCase(TestCase): ...@@ -47,7 +47,7 @@ class ModuleStoreTestCase(TestCase):
modulestore = xmodule.modulestore.django.modulestore() modulestore = xmodule.modulestore.django.modulestore()
# Count the number of templates # Count the number of templates
query = { "_id.course": "templates"} query = {"_id.course": "templates"}
num_templates = modulestore.collection.find(query).count() num_templates = modulestore.collection.find(query).count()
if num_templates < 1: if num_templates < 1:
...@@ -96,7 +96,7 @@ class ModuleStoreTestCase(TestCase): ...@@ -96,7 +96,7 @@ class ModuleStoreTestCase(TestCase):
ModuleStoreTestCase.load_templates_if_necessary() ModuleStoreTestCase.load_templates_if_necessary()
# Call superclass implementation # Call superclass implementation
TestCase._pre_setup(self) super(ModuleStoreTestCase, self)._pre_setup()
def _post_teardown(self): def _post_teardown(self):
''' '''
...@@ -106,7 +106,7 @@ class ModuleStoreTestCase(TestCase): ...@@ -106,7 +106,7 @@ class ModuleStoreTestCase(TestCase):
ModuleStoreTestCase.flush_mongo_except_templates() ModuleStoreTestCase.flush_mongo_except_templates()
# Call superclass implementation # Call superclass implementation
TestCase._post_teardown(self) super(ModuleStoreTestCase, self)._post_teardown()
def parse_json(response): def parse_json(response):
......
...@@ -3,7 +3,6 @@ import unittest ...@@ -3,7 +3,6 @@ import unittest
import threading import threading
import json import json
import urllib import urllib
import urlparse
import time import time
from mock_xqueue_server import MockXQueueServer, MockXQueueRequestHandler from mock_xqueue_server import MockXQueueServer, MockXQueueRequestHandler
......
...@@ -287,7 +287,6 @@ class PageLoaderTestCase(LoginEnrollmentTestCase): ...@@ -287,7 +287,6 @@ class PageLoaderTestCase(LoginEnrollmentTestCase):
self.enroll(course) self.enroll(course)
course_id = course.id course_id = course.id
# Search for items in the course # Search for items in the course
# None is treated as a wildcard # None is treated as a wildcard
course_loc = course.location course_loc = course.location
...@@ -301,7 +300,6 @@ class PageLoaderTestCase(LoginEnrollmentTestCase): ...@@ -301,7 +300,6 @@ class PageLoaderTestCase(LoginEnrollmentTestCase):
else: else:
descriptor = random.choice(items) descriptor = random.choice(items)
# We have ancillary course information now as modules # We have ancillary course information now as modules
# and we can't simply use 'jump_to' to view them # and we can't simply use 'jump_to' to view them
if descriptor.location.category == 'about': if descriptor.location.category == 'about':
...@@ -330,7 +328,6 @@ class PageLoaderTestCase(LoginEnrollmentTestCase): ...@@ -330,7 +328,6 @@ class PageLoaderTestCase(LoginEnrollmentTestCase):
expect_redirect=True, expect_redirect=True,
check_content=True) check_content=True)
def _assert_loads(self, django_url, kwargs, descriptor, def _assert_loads(self, django_url, kwargs, descriptor,
expect_redirect=False, expect_redirect=False,
check_content=False): check_content=False):
...@@ -390,7 +387,6 @@ class TestCoursesLoadTestCase_MongoModulestore(PageLoaderTestCase): ...@@ -390,7 +387,6 @@ class TestCoursesLoadTestCase_MongoModulestore(PageLoaderTestCase):
self.check_random_page_loads(module_store) self.check_random_page_loads(module_store)
@override_settings(MODULESTORE=TEST_DATA_XML_MODULESTORE) @override_settings(MODULESTORE=TEST_DATA_XML_MODULESTORE)
class TestNavigation(LoginEnrollmentTestCase): class TestNavigation(LoginEnrollmentTestCase):
"""Check that navigation state is saved properly""" """Check that navigation state is saved properly"""
...@@ -642,7 +638,7 @@ class TestViewAuth(LoginEnrollmentTestCase): ...@@ -642,7 +638,7 @@ class TestViewAuth(LoginEnrollmentTestCase):
print '=== Checking non-staff access for {0}'.format(course.id) print '=== Checking non-staff access for {0}'.format(course.id)
# Randomly sample a dark url # Randomly sample a dark url
url = random.choice( instructor_urls(course) + url = random.choice(instructor_urls(course) +
dark_student_urls(course) + dark_student_urls(course) +
reverse_urls(['courseware'], course)) reverse_urls(['courseware'], course))
print 'checking for 404 on {0}'.format(url) print 'checking for 404 on {0}'.format(url)
......
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