Commit d494fe22 by Sarina Canelake

Merge pull request #8876 from edx/sarina/pylint

Eliminate various Pylint violations
parents 4a1e6172 49f78b47
......@@ -3,7 +3,6 @@
from lettuce import world, step
from nose.tools import assert_true, assert_equal # pylint: disable=no-name-in-module
from terrain.steps import reload_the_page
from selenium.common.exceptions import StaleElementReferenceException
......
......@@ -3,7 +3,7 @@
from lettuce import world, step
from common import *
from nose.tools import assert_true, assert_false, assert_equal # pylint: disable=no-name-in-module
from nose.tools import assert_true, assert_false # pylint: disable=no-name-in-module
from logging import getLogger
logger = getLogger(__name__)
......
......@@ -2,12 +2,11 @@
# pylint: disable=redefined-outer-name
from lettuce import world, step
from terrain.steps import reload_the_page
from selenium.webdriver.common.keys import Keys
from common import type_in_codemirror, upload_file
from django.conf import settings
from nose.tools import assert_true, assert_false, assert_equal # pylint: disable=no-name-in-module
from nose.tools import assert_true, assert_false # pylint: disable=no-name-in-module
TEST_ROOT = settings.COMMON_TEST_DATA_ROOT
......
......@@ -6,7 +6,7 @@ from common import *
from terrain.steps import reload_the_page
from selenium.common.exceptions import InvalidElementStateException
from contentstore.utils import reverse_course_url
from nose.tools import assert_in, assert_not_in, assert_equal, assert_not_equal # pylint: disable=no-name-in-module
from nose.tools import assert_in, assert_equal, assert_not_equal # pylint: disable=no-name-in-module
@step(u'I am viewing the grading settings')
......@@ -170,7 +170,7 @@ def cannot_edit_fail(_step):
# try to change the grade range -- this should throw an exception
try:
ranges.last.value = 'Failure'
except (InvalidElementStateException):
except InvalidElementStateException:
pass # We should get this exception on failing to edit the element
# check to be sure that nothing has changed
......
......@@ -33,7 +33,7 @@ def see_a_static_page_named_foo(step, name):
@step(u'I should not see any static pages$')
def not_see_any_static_pages(step):
pages_css = 'div.xmodule_StaticTabModule'
assert (world.is_css_not_present(pages_css, wait_time=30))
assert world.is_css_not_present(pages_css, wait_time=30)
@step(u'I "(edit|delete)" the static page$')
......
......@@ -205,7 +205,7 @@ def check_text_in_the_captions(_step, text):
world.wait_for_present('.video.is-captions-rendered')
world.wait_for(lambda _: world.css_text('.subtitles'), timeout=30)
actual_text = world.css_text('.subtitles')
assert (text in actual_text)
assert text in actual_text
@step('I see value "([^"]*)" in the field "([^"]*)"$')
......
......@@ -74,7 +74,7 @@ def check_not_there(_step, file_name):
# the only file that was uploaded, our success criteria
# will be that there are no files.
# In the future we can refactor if necessary.
assert(world.is_css_not_present(ASSET_NAMES_CSS))
assert world.is_css_not_present(ASSET_NAMES_CSS)
@step(u'I should see the file "([^"]*)" was uploaded$')
......
......@@ -29,7 +29,7 @@ class Command(BaseCommand):
raise CommandError("import requires at least one argument: <data directory> [--nostatic] [<course dir>...]")
data_dir = args[0]
do_import_static = not (options.get('nostatic', False))
do_import_static = not options.get('nostatic', False)
if len(args) > 1:
source_dirs = args[1:]
else:
......
......@@ -659,7 +659,7 @@ class MiscCourseTests(ContentStoreTestCase):
direct_store_items = self.store.get_items(
self.course.id, revision=ModuleStoreEnum.RevisionOption.published_only
)
items_from_direct_store = [item for item in direct_store_items if (item.location == self.problem.location)]
items_from_direct_store = [item for item in direct_store_items if item.location == self.problem.location]
self.assertEqual(len(items_from_direct_store), 1)
self.assertFalse(getattr(items_from_direct_store[0], 'is_draft', False))
......@@ -667,7 +667,7 @@ class MiscCourseTests(ContentStoreTestCase):
draft_store_items = self.store.get_items(
self.course.id, revision=ModuleStoreEnum.RevisionOption.draft_only
)
items_from_draft_store = [item for item in draft_store_items if (item.location == self.problem.location)]
items_from_draft_store = [item for item in draft_store_items if item.location == self.problem.location]
self.assertEqual(len(items_from_draft_store), 1)
# TODO the below won't work for split mongo
self.assertTrue(getattr(items_from_draft_store[0], 'is_draft', False))
......
......@@ -87,7 +87,7 @@ def get_lms_link_for_item(location, preview=False):
:param location: the location to jump to
:param preview: True if the preview version of LMS should be returned. Default value is false.
"""
assert(isinstance(location, UsageKey))
assert isinstance(location, UsageKey)
if settings.LMS_BASE is None:
return None
......@@ -109,7 +109,7 @@ def get_lms_link_for_about_page(course_key):
Returns the url to the course about page from the location tuple.
"""
assert(isinstance(course_key, CourseKey))
assert isinstance(course_key, CourseKey)
if settings.FEATURES.get('ENABLE_MKTG_SITE', False):
if not hasattr(settings, 'MKTG_URLS'):
......
......@@ -242,7 +242,7 @@ def xblock_view_handler(request, usage_key_string, view_name):
log.debug("Unable to render %s for %r", view_name, xblock, exc_info=True)
fragment = Fragment(render_to_string('html_error.html', {'message': str(exc)}))
elif view_name in (PREVIEW_VIEWS + container_views):
elif view_name in PREVIEW_VIEWS + container_views:
is_pages_view = view_name == STUDENT_VIEW # Only the "Pages" view uses student view in Studio
can_edit = has_studio_write_access(request.user, usage_key.course_key)
......
......@@ -31,7 +31,6 @@ from student.auth import (
STUDIO_VIEW_USERS, STUDIO_EDIT_ROLES, get_user_permissions, has_studio_read_access, has_studio_write_access
)
from student.roles import CourseInstructorRole, CourseStaffRole, LibraryUserRole
from student import auth
from util.json_request import expect_json, JsonResponse, JsonResponseBadRequest
__all__ = ['library_handler', 'manage_library_users']
......
......@@ -19,7 +19,6 @@ from xmodule.services import SettingsService
from xmodule.modulestore.django import modulestore, ModuleI18nService
from xmodule.mixin import wrap_with_license
from opaque_keys.edx.keys import UsageKey
from opaque_keys.edx.locator import LibraryUsageLocator
from xmodule.x_module import ModuleSystem
from xblock.runtime import KvsFieldData
from xblock.django.request import webob_to_django_response, django_to_webob_request
......
......@@ -5,7 +5,6 @@ from student.auth import has_course_author_access
from util.json_request import expect_json, JsonResponse
from django.http import HttpResponseNotFound
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.views.decorators.csrf import ensure_csrf_cookie
......
......@@ -10,7 +10,7 @@ class CourseActionStateManager(models.Manager):
An abstract Model Manager class for Course Action State models.
This abstract class expects child classes to define the ACTION (string) field.
"""
class Meta:
class Meta(object):
"""Abstract manager class, with subclasses defining the ACTION (string) field."""
abstract = True
......
......@@ -21,7 +21,7 @@ class CourseActionState(models.Model):
For example: course copying (reruns), import, export, and validation.
"""
class Meta:
class Meta(object):
"""
For performance reasons, we disable "concrete inheritance", by making the Model base class abstract.
With the "abstract base class" inheritance model, tables are only created for derived models, not for
......@@ -77,7 +77,7 @@ class CourseActionUIState(CourseActionState):
"""
An abstract django model that is a sub-class of CourseActionState with additional fields related to UI.
"""
class Meta:
class Meta(object):
"""
See comment in CourseActionState on disabling "concrete inheritance".
"""
......@@ -101,7 +101,7 @@ class CourseRerunState(CourseActionUIState):
"""
A concrete django model for maintaining state specifically for the Action Course Reruns.
"""
class Meta:
class Meta(object):
"""
Set the (destination) course_key field to be unique for the rerun action
Although multiple reruns can be in progress simultaneously for a particular source course_key,
......
......@@ -105,7 +105,7 @@ class TestCourseActionUIStateManager(TestCourseActionStateManagerBase):
)
# create course action states for all courses
for CourseState in (self.course_actions_displayable_states + self.courses_with_state3_non_displayable):
for CourseState in self.course_actions_displayable_states + self.courses_with_state3_non_displayable:
action_class.objects.update_state(
CourseState.course_key,
CourseState.state,
......
......@@ -16,7 +16,7 @@ from util.date_utils import get_time_display
class CourseModeForm(forms.ModelForm):
class Meta:
class Meta(object): # pylint: disable=missing-docstring
model = CourseMode
COURSE_MODE_SLUG_CHOICES = (
......
......@@ -82,7 +82,7 @@ class CourseMode(models.Model):
# Modes that allow a student to earn credit with a university partner
CREDIT_MODES = [CREDIT_MODE]
class Meta:
class Meta(object):
""" meta attributes of this model """
unique_together = ('course_id', 'mode_slug', 'currency')
......@@ -457,7 +457,7 @@ class CourseMode(models.Model):
return False
# Check that the default mode is available.
return (cls.HONOR in modes_dict)
return cls.HONOR in modes_dict
@classmethod
def is_white_label(cls, course_id, modes_dict=None):
......
......@@ -57,7 +57,7 @@ class Role(models.Model):
users = models.ManyToManyField(User, related_name="roles")
course_id = CourseKeyField(max_length=255, blank=True, db_index=True)
class Meta:
class Meta(object): # pylint: disable=missing-docstring
# use existing table that was originally created from django_comment_client app
db_table = 'django_comment_client_role'
......@@ -99,7 +99,7 @@ class Permission(models.Model):
name = models.CharField(max_length=30, null=False, blank=False, primary_key=True)
roles = models.ManyToManyField(Role, related_name="permissions")
class Meta:
class Meta(object): # pylint: disable=missing-docstring
# use existing table that was originally created from django_comment_client app
db_table = 'django_comment_client_permission'
......
......@@ -25,7 +25,7 @@ class RestrictedCourseForm(forms.ModelForm):
error message instead.
"""
class Meta: # pylint: disable=missing-docstring
class Meta(object): # pylint: disable=missing-docstring
model = RestrictedCourse
def clean_course_key(self):
......@@ -55,10 +55,10 @@ class RestrictedCourseForm(forms.ModelForm):
return course_key
class IPFilterForm(forms.ModelForm): # pylint: disable=incomplete-protocol
class IPFilterForm(forms.ModelForm):
"""Form validating entry of IP addresses"""
class Meta: # pylint: disable=missing-docstring
class Meta(object): # pylint: disable=missing-docstring
model = IPFilter
def _is_valid_ip(self, address):
......
......@@ -379,7 +379,7 @@ class Country(models.Model):
code=unicode(self.country)
)
class Meta:
class Meta(object):
"""Default ordering is ascending by country code """
ordering = ['country']
......@@ -522,7 +522,7 @@ class CountryAccessRule(models.Model):
cache.delete(cache_key)
log.info("Invalidated country access list for course %s", course_key)
class Meta:
class Meta(object):
"""a course can be added with either black or white list. """
unique_together = (
# This restriction ensures that a country is on
......@@ -646,7 +646,7 @@ class CourseAccessRuleHistory(models.Model):
else:
CourseAccessRuleHistory.save_snapshot(restricted_course)
class Meta: # pylint: disable=missing-docstring,old-style-class
class Meta(object): # pylint: disable=missing-docstring
get_latest_by = 'timestamp'
......
......@@ -14,7 +14,7 @@ from django.contrib.auth.models import User
class ExternalAuthMap(models.Model):
class Meta:
class Meta(object): # pylint: disable=missing-docstring
unique_together = (('external_id', 'external_domain'), )
external_id = models.CharField(max_length=255, db_index=True)
external_domain = models.CharField(max_length=255, db_index=True)
......
......@@ -25,7 +25,7 @@ if settings.FEATURES.get('AUTH_USE_CAS'):
from student.helpers import get_next_url_for_login_page
from student.models import UserProfile
from django.http import HttpResponse, HttpResponseRedirect, HttpRequest, HttpResponseForbidden
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden
from django.utils.http import urlquote, is_safe_url
from django.shortcuts import redirect
from django.utils.translation import ugettext as _
......
......@@ -38,7 +38,7 @@ class MicrositeMiddleware(object):
return response
class MicrositeSessionCookieDomainMiddleware():
class MicrositeSessionCookieDomainMiddleware(object):
"""
Special case middleware which should be at the very end of the MIDDLEWARE list (so that it runs first
on the process_response chain). This middleware will define a wrapper function for the set_cookie() function
......
# Register signal handlers
# pylint: disable=unused-imports
# pylint: disable=unused-import
import signals
import exceptions
......@@ -2,8 +2,6 @@
import datetime
import dateutil
import json
import mock
import unittest
import logging
from StringIO import StringIO
......
......@@ -20,7 +20,7 @@ from opaque_keys import InvalidKeyError
class CourseAccessRoleForm(forms.ModelForm):
"""Form for adding new Course Access Roles view the Django Admin Panel."""
class Meta:
class Meta(object): # pylint: disable=missing-docstring
model = CourseAccessRole
email = forms.EmailField(required=True)
......@@ -123,7 +123,7 @@ class CourseAccessRoleAdmin(admin.ModelAdmin):
class LinkedInAddToProfileConfigurationAdmin(admin.ModelAdmin):
"""Admin interface for the LinkedIn Add to Profile configuration. """
class Meta:
class Meta(object): # pylint: disable=missing-docstring
model = LinkedInAddToProfileConfiguration
# Exclude deprecated fields
......
"""Helpers for the student app. """
import time
from datetime import datetime
import urllib
from pytz import UTC
from django.utils.http import cookie_date
from django.conf import settings
from django.core.urlresolvers import reverse, NoReverseMatch
import third_party_auth
from verify_student.models import SoftwareSecurePhotoVerification # pylint: disable=F0401
from verify_student.models import SoftwareSecurePhotoVerification # pylint: disable=import-error
from course_modes.models import CourseMode
......
......@@ -216,7 +216,7 @@ class UserProfile(models.Model):
MITx fall prototype.
"""
class Meta: # pylint: disable=missing-docstring
class Meta(object): # pylint: disable=missing-docstring
db_table = "auth_userprofile"
# CRITICAL TODO/SECURITY
......@@ -436,7 +436,7 @@ class Registration(models.Model):
registration profile is created when the user creates an
account, but that account is inactive. Once the user clicks
on the activation key, it becomes active. '''
class Meta:
class Meta(object): # pylint: disable=missing-docstring
db_table = "auth_registration"
user = models.ForeignKey(User, unique=True)
......@@ -846,7 +846,7 @@ class CourseEnrollment(models.Model):
objects = CourseEnrollmentManager()
class Meta:
class Meta(object): # pylint: disable=missing-docstring
unique_together = (('user', 'course_id'),)
ordering = ('user', 'course_id')
......@@ -885,7 +885,7 @@ class CourseEnrollment(models.Model):
# save it to the database so that it can have an ID that we can throw
# into our CourseEnrollment object. Otherwise, we'll get an
# IntegrityError for having a null user_id.
assert(isinstance(course_key, CourseKey))
assert isinstance(course_key, CourseKey)
if user.id is None:
user.save()
......@@ -994,7 +994,7 @@ class CourseEnrollment(models.Model):
try:
context = contexts.course_context_from_course_id(self.course_id)
assert(isinstance(self.course_id, CourseKey))
assert isinstance(self.course_id, CourseKey)
data = {
'user_id': self.user.id,
'course_id': self.course_id.to_deprecated_string(),
......@@ -1407,7 +1407,7 @@ class CourseEnrollmentAllowed(models.Model):
created = models.DateTimeField(auto_now_add=True, null=True, db_index=True)
class Meta: # pylint: disable=missing-docstring
class Meta(object): # pylint: disable=missing-docstring
unique_together = (('email', 'course_id'),)
def __unicode__(self):
......@@ -1444,7 +1444,7 @@ class CourseAccessRole(models.Model):
course_id = CourseKeyField(max_length=255, db_index=True, blank=True)
role = models.CharField(max_length=64, db_index=True)
class Meta: # pylint: disable=missing-docstring
class Meta(object): # pylint: disable=missing-docstring
unique_together = ('user', 'org', 'course_id', 'role')
@property
......@@ -1835,7 +1835,7 @@ class LanguageProficiency(models.Model):
/edx-platform/openedx/core/djangoapps/user_api/accounts/views.py or its associated api method
(update_account_settings) so that the events are emitted.
"""
class Meta:
class Meta(object): # pylint: disable=missing-docstring
unique_together = (('code', 'user_profile'),)
user_profile = models.ForeignKey(UserProfile, db_index=True, related_name='language_proficiencies')
......
......@@ -99,7 +99,7 @@ class GlobalStaff(AccessRole):
def add_users(self, *users):
for user in users:
if (user.is_authenticated() and user.is_active):
if user.is_authenticated() and user.is_active:
user.is_staff = True
user.save()
......
......@@ -11,11 +11,11 @@ from student.views import (
from student.models import UserProfile, PendingEmailChange
from django.core.urlresolvers import reverse
from django.core import mail
from django.contrib.auth.models import User, AnonymousUser
from django.contrib.auth.models import User
from django.test import TestCase, TransactionTestCase
from django.test.client import RequestFactory
from mock import Mock, patch
from django.http import Http404, HttpResponse
from django.http import HttpResponse
from django.conf import settings
from edxmako.shortcuts import render_to_string
from edxmako.tests import mako_middleware_process_request
......
"""Tests for the login and registration form rendering. """
import urllib
import unittest
from collections import OrderedDict
import ddt
from mock import patch
......@@ -10,7 +9,6 @@ from django.core.urlresolvers import reverse
from util.testing import UrlResetMixin
from xmodule.modulestore.tests.factories import CourseFactory
from student.tests.factories import CourseModeFactory
from third_party_auth.tests.testutil import ThirdPartyAuthTestMixin
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
......
......@@ -20,7 +20,7 @@ from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from student.tests.factories import UserFactory, CourseEnrollmentFactory
from course_modes.tests.factories import CourseModeFactory
from verify_student.models import SoftwareSecurePhotoVerification # pylint: disable=F0401
from verify_student.models import SoftwareSecurePhotoVerification # pylint: disable=import-error
from util.testing import UrlResetMixin
......
......@@ -10,18 +10,20 @@ import ddt
from django.conf import settings
from django.contrib.auth.models import User, AnonymousUser
from django.contrib.sessions.middleware import SessionMiddleware
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.client import RequestFactory, Client
from django.test.client import Client
from mock import Mock, patch
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from student.models import (
anonymous_id_for_user, user_by_anonymous_id, CourseEnrollment, unique_id_for_user, LinkedInAddToProfileConfiguration
)
from student.views import (process_survey_link, _cert_info,
change_enrollment, complete_course_mode_info)
from student.views import (
process_survey_link,
_cert_info,
complete_course_mode_info,
)
from student.tests.factories import UserFactory, CourseModeFactory
from util.testing import EventTestMixin
from util.model_utils import USER_SETTINGS_CHANGED_EVENT_NAME
......
......@@ -6,7 +6,6 @@ import logging
import uuid
import json
import warnings
from datetime import timedelta
from collections import defaultdict
from pytz import UTC
from requests import HTTPError
......@@ -26,9 +25,8 @@ from django.db import IntegrityError, transaction
from django.http import (HttpResponse, HttpResponseBadRequest, HttpResponseForbidden,
HttpResponseServerError, Http404)
from django.shortcuts import redirect
from django.utils import timezone
from django.utils.translation import ungettext
from django.utils.http import cookie_date, base36_to_int
from django.utils.http import base36_to_int
from django.utils.translation import ugettext as _, get_language
from django.views.decorators.cache import never_cache
from django.views.decorators.csrf import csrf_exempt, ensure_csrf_cookie
......@@ -49,7 +47,7 @@ from edxmako.shortcuts import render_to_response, render_to_string
from course_modes.models import CourseMode
from shoppingcart.api import order_history
from student.models import (
Registration, UserProfile, PendingNameChange,
Registration, UserProfile,
PendingEmailChange, CourseEnrollment, CourseEnrollmentAttribute, unique_id_for_user,
CourseEnrollmentAllowed, UserStanding, LoginFailures,
create_comments_service_user, PasswordHistory, UserSignupSource,
......@@ -60,10 +58,8 @@ from verify_student.models import SoftwareSecurePhotoVerification # pylint: dis
from certificates.models import CertificateStatuses, certificate_status_for_student
from certificates.api import ( # pylint: disable=import-error
get_certificate_url,
get_active_web_certificate,
has_html_certificates_enabled,
)
from dark_lang.models import DarkLangConfig
from xmodule.modulestore.django import modulestore
from opaque_keys import InvalidKeyError
......@@ -86,7 +82,6 @@ from external_auth.login_and_register import (
)
from bulk_email.models import Optout, CourseAuthorization
import shoppingcart
from lang_pref import LANGUAGE_KEY
import track.views
......@@ -1048,7 +1043,7 @@ def accounts_login(request):
# Need different levels of logging
@ensure_csrf_cookie
def login_user(request, error=""): # pylint: disable-msg=too-many-statements,unused-argument
def login_user(request, error=""): # pylint: disable=too-many-statements,unused-argument
"""AJAX request to log in the user."""
backend_name = None
......
......@@ -95,7 +95,7 @@ def the_page_title_should_be(step, title):
@step(u'the page title should contain "([^"]*)"$')
def the_page_title_should_contain(step, title):
assert(title in world.browser.title)
assert title in world.browser.title
@step('I log in$')
......
......@@ -58,7 +58,7 @@ See http://psa.matiasaguirre.net/docs/pipeline.html for more docs.
"""
import random
import string # pylint: disable-msg=deprecated-module
import string # pylint: disable=deprecated-module
from collections import OrderedDict
import urllib
import analytics
......@@ -80,9 +80,6 @@ from logging import getLogger
from . import provider
# Note that this lives in openedx, so this dependency should be refactored.
from openedx.core.djangoapps.user_api.preferences.api import update_email_opt_in
# These are the query string params you can pass
# to the URL that starts the authentication process.
......@@ -434,7 +431,7 @@ def running(request):
# Pipeline functions.
# Signatures are set by python-social-auth; prepending 'unused_' causes
# TypeError on dispatch to the auth backend's authenticate().
# pylint: disable-msg=unused-argument
# pylint: disable=unused-argument
def parse_query_params(strategy, response, *args, **kwargs):
......
"""Base integration test for provider implementations."""
import re
import unittest
import json
......
"""Integration tests for Google providers."""
from third_party_auth import provider
from third_party_auth.tests.specs import base
......
"""Integration tests for LinkedIn providers."""
from third_party_auth import provider
from third_party_auth.tests.specs import base
......
......@@ -2,13 +2,13 @@
import random
from third_party_auth import pipeline, provider
from third_party_auth import pipeline
from third_party_auth.tests import testutil
import unittest
# Allow tests access to protected methods (or module-protected methods) under
# test. pylint: disable-msg=protected-access
# Allow tests access to protected methods (or module-protected methods) under test.
# pylint: disable=protected-access
class MakeRandomPasswordTest(testutil.TestCase):
......
......@@ -13,7 +13,7 @@ from social.apps.django_app.default import models as social_models
# Get Django User model by reference from python-social-auth. Not a type
# constant, pylint.
User = social_models.DjangoStorage.user.user_model() # pylint: disable-msg=invalid-name
User = social_models.DjangoStorage.user.user_model() # pylint: disable=invalid-name
class TestCase(testutil.TestCase, test.TestCase):
......
......@@ -21,10 +21,10 @@ _SETTINGS_MAP = {
class SettingsUnitTest(testutil.TestCase):
"""Unit tests for settings management code."""
# Allow access to protected methods (or module-protected methods) under
# test. pylint: disable-msg=protected-access
# Allow access to protected methods (or module-protected methods) under test.
# pylint: disable=protected-access
# Suppress sprurious no-member warning on fakes.
# pylint: disable-msg=no-member
# pylint: disable=no-member
def setUp(self):
super(SettingsUnitTest, self).setUp()
......
......@@ -46,7 +46,7 @@ class TrackingLog(models.Model):
time = models.DateTimeField('event time')
host = models.CharField(max_length=64, blank=True)
class Meta:
class Meta(object): # pylint: disable=missing-docstring
app_label = 'track'
db_table = 'track_trackinglog'
......
......@@ -49,7 +49,7 @@ def course_context_from_course_id(course_id):
return {'course_id': '', 'org_id': ''}
# TODO: Make this accept any CourseKey, and serialize it using .to_string
assert(isinstance(course_id, CourseKey))
assert isinstance(course_id, CourseKey)
return {
'course_id': course_id.to_deprecated_string(),
'org_id': course_id.org,
......
# pylint: disable=unused-import, missing-docstring
from track.backends.django import TrackingLog
......@@ -3,18 +3,14 @@
from mock import patch, sentinel
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from eventtracking import tracker
from track import views
from track.middleware import TrackMiddleware
from track.tests import EventTrackingTestCase, FROZEN_TIME
from openedx.core.lib.tests.assertions.events import assert_event_matches
from datetime import datetime
class TestTrackViews(EventTrackingTestCase):
......
......@@ -631,7 +631,7 @@ class LoncapaProblem(object):
parent = inc.getparent()
parent.insert(parent.index(inc), incxml)
parent.remove(inc)
log.debug('Included %s into %s' % (filename, self.problem_id))
log.debug('Included %s into %s', filename, self.problem_id)
def _extract_system_path(self, script):
"""
......@@ -853,7 +853,7 @@ class LoncapaProblem(object):
answer_id = 1
input_tags = inputtypes.registry.registered_tags()
inputfields = tree.xpath(
"|".join(['//' + response.tag + '[@id=$id]//' + x for x in (input_tags + solution_tags)]),
"|".join(['//' + response.tag + '[@id=$id]//' + x for x in input_tags + solution_tags]),
id=response_id_str
)
......
......@@ -99,7 +99,7 @@ def check_that_blanks_fail(problem):
for answer_id in problem.get_question_answers())
grading_results = problem.grade_answers(blank_answers)
try:
assert(all(result == 'incorrect' for result in grading_results.values()))
assert all(result == 'incorrect' for result in grading_results.values())
except AssertionError:
log.error("Blank accepted as correct answer in {0} for {1}"
.format(problem,
......
......@@ -2719,7 +2719,7 @@ class ExternalResponse(LoncapaResponse):
exans = [''] * len(self.answer_ids)
exans[0] = msg
if not (len(exans) == len(self.answer_ids)):
if not len(exans) == len(self.answer_ids):
log.error('Expected %s answers from external server, only got %s!',
len(self.answer_ids), len(exans))
raise Exception('Short response from external server')
......
......@@ -80,7 +80,7 @@ class ResponseXMLFactory(object):
# Add input elements
for __ in range(int(num_inputs)):
input_element = self.create_input_element(**kwargs)
if not (None == input_element):
if not None == input_element:
response_element.append(input_element)
# The problem has an explanation of the solution
......@@ -146,7 +146,7 @@ class ResponseXMLFactory(object):
choice_names = kwargs.get('choice_names', [None] * len(choices))
# Create the <choicegroup>, <checkboxgroup>, or <radiogroup> element
assert(choice_type in group_element_names)
assert choice_type in group_element_names
group_element = etree.Element(group_element_names[choice_type])
# Create the <choice> elements
......@@ -412,8 +412,8 @@ class FormulaResponseXMLFactory(ResponseXMLFactory):
answer = kwargs.get("answer", None)
hint_list = kwargs.get("hints", None)
assert(answer)
assert(sample_dict and num_samples)
assert answer
assert sample_dict and num_samples
# Create the <formularesponse> element
response_element = etree.Element("formularesponse")
......@@ -518,7 +518,7 @@ class ImageResponseXMLFactory(ResponseXMLFactory):
rectangle = kwargs.get('rectangle', None)
regions = kwargs.get('regions', None)
assert(rectangle or regions)
assert rectangle or regions
# Create the <imageinput> element
input_element = etree.Element("imageinput")
......@@ -635,9 +635,9 @@ class OptionResponseXMLFactory(ResponseXMLFactory):
options_list = kwargs.get('options', None)
correct_option = kwargs.get('correct_option', None)
assert(options_list and correct_option)
assert(len(options_list) > 1)
assert(correct_option in options_list)
assert options_list and correct_option
assert len(options_list) > 1
assert correct_option in options_list
# Create the <optioninput> element
optioninput_element = etree.Element("optioninput")
......
......@@ -12,7 +12,7 @@ from lxml.etree import XMLParser as _XMLParser
from lxml.etree import _Element, _ElementTree # pylint: disable=unused-import, no-name-in-module
# This should be imported after lxml.etree so that it overrides the following attributes.
from defusedxml.lxml import parse, fromstring, XML
from defusedxml.lxml import parse, fromstring, XML # pylint: disable=unused-import
class XMLParser(_XMLParser): # pylint: disable=function-redefined
......
......@@ -309,7 +309,7 @@ class formula(object):
with 'scriptN'. There have been problems using script_N or script(N)
"""
for child in parent:
if (gettag(child) == 'mstyle' and child.get('mathvariant') == 'script'):
if gettag(child) == 'mstyle' and child.get('mathvariant') == 'script':
newchild = etree.Element('mi')
newchild.text = 'script%s' % flatten_pmathml(child[0])
parent.replace(child, newchild)
......@@ -397,7 +397,7 @@ class formula(object):
"""
for child in parent:
# fix msubsup
if (gettag(child) == 'msubsup' and len(child) == 3):
if gettag(child) == 'msubsup' and len(child) == 3:
newchild = etree.Element('msup')
newbase = etree.Element('mi')
newbase.text = '%s_%s' % (flatten_pmathml(child[0]), flatten_pmathml(child[1]))
......
......@@ -86,7 +86,7 @@ def check(expect, given, numerical=False, matrix=False, normphase=False, abcsym=
threshold = float(st)
numerical = True
if str(given) == '' and not (str(expect) == ''):
if str(given) == '' and not str(expect) == '':
return {'ok': False, 'msg': ''}
try:
......@@ -125,12 +125,12 @@ def check(expect, given, numerical=False, matrix=False, normphase=False, abcsym=
#msg += "dm = " + to_latex(dm) + " diff = " + str(abs(dm.vec().norm().evalf()))
#msg += "expect = " + to_latex(xexpect)
elif dosimplify:
if (sympy.simplify(xexpect) == sympy.simplify(xgiven)):
if sympy.simplify(xexpect) == sympy.simplify(xgiven):
return {'ok': True, 'msg': msg}
elif numerical:
if (abs((xexpect - xgiven).evalf(chop=True)) < threshold):
if abs((xexpect - xgiven).evalf(chop=True)) < threshold:
return {'ok': True, 'msg': msg}
elif (xexpect == xgiven):
elif xexpect == xgiven:
return {'ok': True, 'msg': msg}
#msg += "<p/>expect='%s', given='%s'" % (expect,given) # debugging
......@@ -149,9 +149,9 @@ def make_error_message(msg):
def is_within_tolerance(expected, actual, tolerance):
if expected == 0:
return (abs(actual) < tolerance)
return abs(actual) < tolerance
else:
return (abs(abs(actual - expected) / expected) < tolerance)
return abs(abs(actual - expected) / expected) < tolerance
#-----------------------------------------------------------------------------
# Check function interface, which takes pmathml input
......@@ -198,10 +198,11 @@ def symmath_check(expect, ans, dynamath=None, options=None, debug=None, xml=None
DEBUG = False
# options
do_matrix = 'matrix' in (options or '')
do_qubit = 'qubit' in (options or '')
do_imaginary = 'imaginary' in (options or '')
do_numerical = 'numerical' in (options or '')
if options is None:
options = ''
do_matrix = 'matrix' in options
do_qubit = 'qubit' in options
do_numerical = 'numerical' in options
# parse expected answer
try:
......@@ -254,7 +255,7 @@ def symmath_check(expect, ans, dynamath=None, options=None, debug=None, xml=None
fsym = f.sympy
msg += '<p>You entered: %s</p>' % to_latex(f.sympy)
except Exception, err:
log.exception("Error evaluating expression '%s' as a valid equation" % ans)
log.exception("Error evaluating expression '%s' as a valid equation", ans)
msg += "<p>Error in evaluating your expression '%s' as a valid equation</p>" % (ans)
if "Illegal math" in str(err):
msg += "<p>Illegal math expression</p>"
......
......@@ -469,7 +469,7 @@ class CapaMixin(CapaFields):
# If the problem is closed (and not a survey question with max_attempts==0),
# then do NOT show the reset button.
if (self.closed() and not is_survey_question):
if self.closed() and not is_survey_question:
return False
# Button only shows up for randomized problems if the question has been submitted
......
......@@ -143,7 +143,7 @@ class CapaDescriptor(CapaFields, RawDescriptor):
Show them only if use_latex_compiler is set to True in
course settings.
"""
return ('latex' not in template['template_id'] or course.use_latex_compiler)
return 'latex' not in template['template_id'] or course.use_latex_compiler
def get_context(self):
_context = RawDescriptor.get_context(self)
......
......@@ -105,7 +105,7 @@ class StaticContent(object):
if course_key is None:
return None
assert(isinstance(course_key, CourseKey))
assert isinstance(course_key, CourseKey)
placeholder_id = uuid.uuid4().hex
# create a dummy asset location with a fake but unique name. strip off the name, and return it
url_path = StaticContent.serialize_asset_key_with_slash(
......
......@@ -118,7 +118,7 @@ class Textbook(object):
pass
# Get the table of contents from S3
log.info("Retrieving textbook table of contents from %s" % toc_url)
log.info("Retrieving textbook table of contents from %s", toc_url)
try:
r = requests.get(toc_url)
except Exception as err:
......@@ -1009,7 +1009,7 @@ class CourseDescriptor(CourseFields, SequenceDescriptor, LicenseMixin):
policy_str = grading_policy_file.read()
# if we successfully read the file, stop looking at backups
break
except (IOError):
except IOError:
msg = "Unable to load course settings file from '{0}'".format(policy_path)
log.warning(msg)
......
......@@ -4,7 +4,6 @@ from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
from xmodule.editing_module import MetadataOnlyEditingDescriptor
from xblock.fields import String, Scope, UNIQUE_ID
from uuid import uuid4
# Make '_' a no-op so we can scrape strings
_ = lambda text: text
......
......@@ -310,7 +310,7 @@ class AssignmentFormatGrader(CourseGrader):
if index not in dropped_indices:
aggregate_score += mark['percent']
if (len(breakdown) - drop_count > 0):
if len(breakdown) - drop_count > 0:
aggregate_score /= len(breakdown) - drop_count
return aggregate_score, dropped_indices
......
......@@ -135,7 +135,7 @@ class HtmlDescriptor(HtmlFields, XmlDescriptor, EditingDescriptor): # pylint: d
Show them only if use_latex_compiler is set to True in
course settings.
"""
return ('latex' not in template['template_id'] or course.use_latex_compiler)
return 'latex' not in template['template_id'] or course.use_latex_compiler
def get_context(self):
"""
......
......@@ -1151,7 +1151,7 @@ class ModuleStoreReadBase(BulkOperationsMixin, ModuleStoreRead):
# pylint: disable=fixme
# TODO (vshnayder): post-launch, make errors properties of items
# self.get_item(location)
assert(isinstance(course_key, CourseKey))
assert isinstance(course_key, CourseKey)
return self._course_errors[course_key].errors
def get_errored_courses(self):
......@@ -1169,7 +1169,7 @@ class ModuleStoreReadBase(BulkOperationsMixin, ModuleStoreRead):
Default impl--linear search through course list
"""
assert(isinstance(course_id, CourseKey))
assert isinstance(course_id, CourseKey)
for course in self.get_courses(**kwargs):
if course.id == course_id:
return course
......@@ -1184,7 +1184,7 @@ class ModuleStoreReadBase(BulkOperationsMixin, ModuleStoreRead):
to search for whether a potentially conflicting course exists in that case.
"""
# linear search through list
assert(isinstance(course_id, CourseKey))
assert isinstance(course_id, CourseKey)
if ignore_case:
return next(
(
......
......@@ -1495,7 +1495,7 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase):
partitioned_fields = self.partition_fields_by_scope(block_type, fields)
new_def_data = partitioned_fields.get(Scope.content, {})
# persist the definition if persisted != passed
if (definition_locator is None or isinstance(definition_locator.definition_id, LocalId)):
if definition_locator is None or isinstance(definition_locator.definition_id, LocalId):
definition_locator = self.create_definition_from_data(course_key, new_def_data, block_type, user_id)
elif new_def_data:
definition_locator, _ = self.update_definition_from_data(course_key, definition_locator, new_def_data, user_id)
......@@ -2770,7 +2770,7 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase):
course_key.version_guid is None or
index_entry['versions'][course_key.branch] == course_key.version_guid
)
if (is_head or force):
if is_head or force:
return index_entry
else:
raise VersionConflictError(
......
......@@ -3,8 +3,6 @@ Factories for use in tests of XBlocks.
"""
import functools
import inspect
import pprint
import pymongo.message
import threading
import traceback
......@@ -14,7 +12,7 @@ from uuid import uuid4
from factory import Factory, Sequence, lazy_attribute_sequence, lazy_attribute
from factory.containers import CyclicDefinitionError
from mock import Mock, patch
from mock import patch
from nose.tools import assert_less_equal, assert_greater_equal
import dogstats_wrapper as dog_stats_api
......
......@@ -8,7 +8,6 @@ import logging
import ddt
import itertools
import mimetypes
from unittest import skip
from uuid import uuid4
from contextlib import contextmanager
from mock import patch
......@@ -1408,7 +1407,7 @@ class TestMixedModuleStore(CommonMixedModuleStoreSetup):
course_id.make_usage_key('course_info', 'updates'),
]
for location in (orphan_locations + detached_locations):
for location in orphan_locations + detached_locations:
self.store.create_item(
self.user_id,
location.course_key,
......
......@@ -3,7 +3,6 @@ Tests for XML importer.
"""
import mock
from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator
from xblock.core import XBlock
from xblock.fields import String, Scope, ScopeIds, List
from xblock.runtime import Runtime, KvsFieldData, DictKeyValueStore
from xmodule.x_module import XModuleMixin
......
......@@ -866,7 +866,7 @@ class XMLModuleStore(ModuleStoreReadBase):
:return: list of course locations
"""
courses = self.get_courses()
return [course.location.course_key for course in courses if (course.wiki_slug == wiki_slug)]
return [course.location.course_key for course in courses if course.wiki_slug == wiki_slug]
def heartbeat(self):
"""
......
......@@ -298,7 +298,7 @@ class OpenEndedChild(object):
def _allow_reset(self):
"""Can the module be reset?"""
return (self.child_state == self.DONE and self.child_attempts < self.max_attempts)
return self.child_state == self.DONE and self.child_attempts < self.max_attempts
def max_score(self):
"""
......@@ -396,7 +396,7 @@ class OpenEndedChild(object):
@return: Boolean correct.
"""
correct = False
if (isinstance(score, (int, long, float, complex))):
if isinstance(score, (int, long, float, complex)):
score_ratio = int(score) / float(self.max_score())
correct = (score_ratio >= 0.66)
return correct
......
......@@ -118,7 +118,7 @@ class PeerGradingModule(PeerGradingFields, XModule):
# We need to set the location here so the child modules can use it.
self.runtime.set('location', self.location)
if (self.runtime.open_ended_grading_interface):
if self.runtime.open_ended_grading_interface:
self.peer_gs = PeerGradingService(self.system.open_ended_grading_interface, self.system.render_template)
else:
self.peer_gs = MockPeerGradingService()
......
......@@ -146,7 +146,7 @@ class CourseTab(object):
"""
Overrides the not equal operator as a partner to the equal operator.
"""
return not (self == other)
return not self == other
@classmethod
def validate(cls, tab_dict, raise_error=True):
......
......@@ -63,7 +63,7 @@ class CapaFactory(object):
"""
Return the input key to use when passing GET parameters
"""
return ("input_" + cls.answer_key(response_num, input_num))
return "input_" + cls.answer_key(response_num, input_num)
@classmethod
def answer_key(cls, response_num=2, input_num=1):
......
......@@ -241,25 +241,25 @@ class IsNewCourseTestCase(unittest.TestCase):
def test_is_newish(self):
descriptor = get_dummy_course(start='2012-12-02T12:00', is_new=True)
assert(descriptor.is_newish is True)
assert descriptor.is_newish is True
descriptor = get_dummy_course(start='2013-02-02T12:00', is_new=False)
assert(descriptor.is_newish is False)
assert descriptor.is_newish is False
descriptor = get_dummy_course(start='2013-02-02T12:00', is_new=True)
assert(descriptor.is_newish is True)
assert descriptor.is_newish is True
descriptor = get_dummy_course(start='2013-01-15T12:00')
assert(descriptor.is_newish is True)
assert descriptor.is_newish is True
descriptor = get_dummy_course(start='2013-03-01T12:00')
assert(descriptor.is_newish is True)
assert descriptor.is_newish is True
descriptor = get_dummy_course(start='2012-10-15T12:00')
assert(descriptor.is_newish is False)
assert descriptor.is_newish is False
descriptor = get_dummy_course(start='2012-12-31T12:00')
assert(descriptor.is_newish is True)
assert descriptor.is_newish is True
def test_end_date_text(self):
# No end date set, returns empty string.
......
......@@ -58,7 +58,7 @@ class CapaFactoryWithDelay(object):
"""
Return the input key to use when passing GET parameters
"""
return ("input_" + cls.answer_key(input_num))
return "input_" + cls.answer_key(input_num)
@classmethod
def answer_key(cls, input_num=2):
......
......@@ -462,7 +462,7 @@ def get_or_create_sjson(item, transcripts):
source_subs_id, result_subs_dict = user_subs_id, {1.0: user_subs_id}
try:
sjson_transcript = Transcript.asset(item.location, source_subs_id, item.transcript_language).data
except (NotFoundError): # generating sjson from srt
except NotFoundError: # generating sjson from srt
generate_sjson_for_all_speeds(item, user_filename, result_subs_dict, item.transcript_language)
sjson_transcript = Transcript.asset(item.location, source_subs_id, item.transcript_language).data
return sjson_transcript
......
......@@ -125,7 +125,7 @@ class VideoStudentViewHandlers(object):
try:
sjson_transcript = Transcript.asset(self.location, youtube_id, self.transcript_language).data
except (NotFoundError):
except NotFoundError:
log.info("Can't find content in storage for %s transcript: generating.", youtube_id)
generate_sjson_for_all_speeds(
self,
......
......@@ -6,7 +6,6 @@ import datetime
from xblock.fields import Scope, String, Float, Boolean, List, Dict, DateTime
from xmodule.fields import RelativeTime
from xmodule.mixin import LicenseMixin
# Make '_' a no-op so we can scrape strings
_ = lambda text: text
......
......@@ -2,7 +2,6 @@
# But w/o css delimiters between children
from xmodule.vertical_block import VerticalBlock
from pkg_resources import resource_string
# HACK: This shouldn't be hard-coded to two types
# OBSOLETE: This obsoletes 'type'
......
......@@ -371,7 +371,7 @@ class XModuleMixin(XModuleFields, XBlock):
"""
result = {}
for field in self.fields.values():
if (field.scope == scope and field.is_set_on(self)):
if field.scope == scope and field.is_set_on(self):
result[field.name] = field.read_json(self)
return result
......
......@@ -4,7 +4,6 @@ Student dashboard page.
"""
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise
from . import BASE_URL
......
......@@ -174,7 +174,7 @@ class EdxNotesPageView(PageObject):
self.q(css=self.TAB_SELECTOR).first.click()
try:
return self.wait_for_page()
except (BrokenPromise):
except BrokenPromise:
raise PageLoadError("Timed out waiting to load page '{!r}'".format(self))
def is_browser_on_page(self):
......
......@@ -3,7 +3,6 @@ Find courses page (main page of the LMS).
"""
from bok_choy.page_object import PageObject
from bok_choy.promise import BrokenPromise
from . import BASE_URL
......
......@@ -197,7 +197,7 @@ class CombinedLoginAndRegisterPage(PageObject):
self.q(css="#register-password").fill(password)
if country:
self.q(css="#register-country option[value='{country}']".format(country=country)).click()
if (terms_of_service):
if terms_of_service:
self.q(css="#register-honor_code").click()
# Submit it
......
"""Payment and verification pages"""
import re
from urllib import urlencode
from bok_choy.page_object import PageObject, unguarded
from bok_choy.promise import Promise, EmptyPromise
from bok_choy.page_object import PageObject
from bok_choy.promise import Promise
from . import BASE_URL
from .dashboard import DashboardPage
......
"""Track selection page"""
from urllib import urlencode
from bok_choy.page_object import PageObject, unguarded
from bok_choy.promise import Promise, EmptyPromise
from bok_choy.page_object import PageObject
from . import BASE_URL
from .dashboard import DashboardPage
from .pay_and_verify import PaymentAndVerificationFlow
......
......@@ -8,7 +8,6 @@ from bok_choy.promise import EmptyPromise
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from .course_page import CoursePage
from .container import ContainerPage
......@@ -405,7 +404,7 @@ class CourseOutlineSection(CourseOutlineContainer, CourseOutlineChild):
self.add_child()
class ExpandCollapseLinkState:
class ExpandCollapseLinkState(object):
"""
Represents the three states that the expand/collapse link can be in
"""
......
"""
Single page performance tests for LMS.
"""
from bok_choy.web_app_test import WebAppTest, with_cache
from bok_choy.web_app_test import with_cache
from ..pages.lms.auto_auth import AutoAuthPage
from ..pages.lms.courseware import CoursewarePage
from ..pages.lms.dashboard import DashboardPage
......
......@@ -9,7 +9,6 @@ from unittest import skip
from nose.plugins.attrib import attr
from bok_choy.promise import EmptyPromise
from bok_choy.web_app_test import WebAppTest
from ..helpers import (
UniqueCourseTest,
EventsTestMixin,
......
......@@ -2,9 +2,7 @@
Test course discovery.
"""
import datetime
from flaky import flaky
import json
import os
from bok_choy.web_app_test import WebAppTest
from ..helpers import remove_file
......
"""
Test courseware search
"""
import os
import json
from nose.plugins.attrib import attr
......
import os
"""
Test LMS Notes
"""
from uuid import uuid4
from datetime import datetime
from nose.plugins.attrib import attr
......
......@@ -7,7 +7,6 @@ from ..helpers import UniqueCourseTest, create_user_partition_json
from ...pages.studio.auto_auth import AutoAuthPage
from ...pages.lms.courseware import CoursewarePage
from ...pages.lms.staff_view import StaffPage
from ...pages.lms.course_nav import CourseNavPage
from ...fixtures.course import CourseFixture, XBlockFixtureDesc
from xmodule.partitions.partitions import Group
from textwrap import dedent
......
......@@ -3,7 +3,6 @@ Acceptance tests for Home Page (My Courses / My Libraries).
"""
from bok_choy.web_app_test import WebAppTest
from opaque_keys.edx.locator import LibraryLocator
from unittest import skip
from ...pages.studio.auto_auth import AutoAuthPage
from ...pages.studio.library import LibraryEditPage
......
......@@ -2,7 +2,6 @@
Acceptance tests for Content Libraries in Studio
"""
from ddt import ddt, data
from unittest import skip
from nose.plugins.attrib import attr
from flaky import flaky
......
......@@ -141,13 +141,16 @@ class WarningMessagesTest(CourseOutlineTest):
FUTURE_UNPUBLISHED_WARNING = 'Unpublished changes to content that will release in the future'
NEVER_PUBLISHED_WARNING = 'Unpublished units will not be released'
class PublishState:
class PublishState(object):
"""
Default values for representing the published state of a unit
"""
NEVER_PUBLISHED = 1
UNPUBLISHED_CHANGES = 2
PUBLISHED = 3
VALUES = [NEVER_PUBLISHED, UNPUBLISHED_CHANGES, PUBLISHED]
class UnitState:
class UnitState(object):
""" Represents the state of a unit """
def __init__(self, is_released, publish_state, is_locked):
......
......@@ -14,7 +14,6 @@ from ...pages.studio.settings import SettingsPage
from ...pages.studio.settings_advanced import AdvancedSettingsPage
from ...pages.studio.settings_group_configurations import GroupConfigurationsPage
from ...pages.lms.courseware import CoursewarePage
from unittest import skip
from textwrap import dedent
from xmodule.partitions.partitions import Group
......
......@@ -2,7 +2,6 @@
Acceptance tests for Studio related to the split_test module.
"""
import json
import math
from unittest import skip
from nose.plugins.attrib import attr
......
......@@ -2,8 +2,6 @@
"""
E2E tests for the LMS.
"""
import time
from unittest import skip
from .helpers import UniqueCourseTest
......@@ -11,7 +9,6 @@ from ..pages.studio.auto_auth import AutoAuthPage
from ..pages.lms.courseware import CoursewarePage
from ..pages.lms.annotation_component import AnnotationComponentPage
from ..fixtures.course import CourseFixture, XBlockFixtureDesc
from ..fixtures.xqueue import XQueueResponseFixture
from textwrap import dedent
......
......@@ -150,7 +150,7 @@ class CcxFieldOverride(models.Model):
location = LocationKeyField(max_length=255, db_index=True)
field = models.CharField(max_length=255)
class Meta: # pylint: disable=missing-docstring,old-style-class
class Meta(object): # pylint: disable=missing-docstring
unique_together = (('ccx', 'location', 'field'),)
value = models.TextField(default='null')
......@@ -16,7 +16,6 @@ from django.core.urlresolvers import reverse
from django.http import (
HttpResponse,
HttpResponseForbidden,
HttpResponseRedirect,
)
from django.contrib import messages
from django.core.exceptions import ValidationError
......@@ -26,23 +25,22 @@ from django.shortcuts import redirect
from django.utils.translation import ugettext as _
from django.views.decorators.cache import cache_control
from django.views.decorators.csrf import ensure_csrf_cookie
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from courseware.courses import get_course_by_id # pylint: disable=import-error
from courseware.courses import get_course_by_id
from courseware.field_overrides import disable_overrides # pylint: disable=import-error
from courseware.grades import iterate_grades_for # pylint: disable=import-error
from courseware.model_data import FieldDataCache # pylint: disable=import-error
from courseware.module_render import get_module_for_descriptor # pylint: disable=import-error
from edxmako.shortcuts import render_to_response # pylint: disable=import-error
from courseware.field_overrides import disable_overrides
from courseware.grades import iterate_grades_for
from courseware.model_data import FieldDataCache
from courseware.module_render import get_module_for_descriptor
from edxmako.shortcuts import render_to_response
from opaque_keys.edx.keys import CourseKey
from ccx_keys.locator import CCXLocator
from student.roles import CourseCcxCoachRole # pylint: disable=import-error
from student.roles import CourseCcxCoachRole
from instructor.offline_gradecalc import student_grades # pylint: disable=import-error
from instructor.views.api import _split_input_list # pylint: disable=import-error
from instructor.views.tools import get_student_from_identifier # pylint: disable=import-error
from instructor.offline_gradecalc import student_grades
from instructor.views.api import _split_input_list
from instructor.views.tools import get_student_from_identifier
from .models import CustomCourseForEdX, CcxMembership
from .overrides import (
......
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