Merge pull request #9171 from edx/ned/update-pylint
Update pylint and astroid, reduces pylint count by 400
This commit is contained in:
@@ -361,7 +361,7 @@ class TestMasqueradedGroup(StaffMasqueradeTestCase):
|
||||
|
||||
# Now setup the masquerade for the test user
|
||||
setup_masquerade(request, self.test_user, True)
|
||||
scheme = self.user_partition.scheme # pylint: disable=no-member
|
||||
scheme = self.user_partition.scheme
|
||||
self.assertEqual(
|
||||
scheme.get_group_for_user(self.course.id, self.test_user, self.user_partition),
|
||||
group
|
||||
|
||||
@@ -609,7 +609,6 @@ class TestAccountAPI(UserAPITestCase):
|
||||
"""
|
||||
self.client.login(username=self.user.username, password=self.test_password)
|
||||
response = self.send_get(self.client)
|
||||
# pylint: disable=no-member
|
||||
self.assertEqual(
|
||||
response.data["profile_image"],
|
||||
{
|
||||
|
||||
@@ -324,7 +324,7 @@ class UpdateEmailOptInTests(ModuleStoreTestCase):
|
||||
# Set year of birth
|
||||
user = User.objects.get(username=self.USERNAME)
|
||||
profile = UserProfile.objects.get(user=user)
|
||||
year_of_birth = datetime.datetime.now().year - age # pylint: disable=maybe-no-member
|
||||
year_of_birth = datetime.datetime.now().year - age
|
||||
profile.year_of_birth = year_of_birth
|
||||
profile.save()
|
||||
|
||||
@@ -374,7 +374,7 @@ class UpdateEmailOptInTests(ModuleStoreTestCase):
|
||||
# Set year of birth
|
||||
user = User.objects.get(username=self.USERNAME)
|
||||
profile = UserProfile.objects.get(user=user)
|
||||
year_of_birth = datetime.datetime.now(UTC).year - age # pylint: disable=maybe-no-member
|
||||
year_of_birth = datetime.datetime.now(UTC).year - age
|
||||
profile.year_of_birth = year_of_birth
|
||||
profile.save()
|
||||
|
||||
|
||||
@@ -1016,7 +1016,7 @@ class RegistrationViewTest(ThirdPartyAuthTestMixin, ApiTestCase):
|
||||
)
|
||||
|
||||
def test_register_form_year_of_birth(self):
|
||||
this_year = datetime.datetime.now(UTC).year # pylint: disable=maybe-no-member
|
||||
this_year = datetime.datetime.now(UTC).year
|
||||
year_options = (
|
||||
[{"value": "", "name": "--", "default": True}] + [
|
||||
{"value": unicode(year), "name": unicode(year)}
|
||||
|
||||
@@ -168,13 +168,13 @@ class TestConditionalContent(ModuleStoreTestCase):
|
||||
UserCourseTagFactory(
|
||||
user=self.student_a,
|
||||
course_id=self.course.id,
|
||||
key='xblock.partition_service.partition_{0}'.format(self.partition.id), # pylint: disable=no-member
|
||||
key='xblock.partition_service.partition_{0}'.format(self.partition.id),
|
||||
value=str(self.user_partition_group_a)
|
||||
)
|
||||
UserCourseTagFactory(
|
||||
user=self.student_b,
|
||||
course_id=self.course.id,
|
||||
key='xblock.partition_service.partition_{0}'.format(self.partition.id), # pylint: disable=no-member
|
||||
key='xblock.partition_service.partition_{0}'.format(self.partition.id),
|
||||
value=str(self.user_partition_group_b)
|
||||
)
|
||||
|
||||
@@ -192,7 +192,7 @@ class TestConditionalContent(ModuleStoreTestCase):
|
||||
parent_location=problem_vertical.location,
|
||||
category='split_test',
|
||||
display_name='Split Test',
|
||||
user_partition_id=self.partition.id, # pylint: disable=no-member
|
||||
user_partition_id=self.partition.id,
|
||||
group_id_to_child={str(index): url for index, url in enumerate([vertical_a_url, vertical_b_url])}
|
||||
)
|
||||
self.vertical_a = ItemFactory.create(
|
||||
|
||||
@@ -134,8 +134,8 @@ def view_auth_classes(is_user=False):
|
||||
|
||||
def add_serializer_errors(serializer, data, field_errors):
|
||||
"""Adds errors from serializer validation to field_errors. data is the original data to deserialize."""
|
||||
if not serializer.is_valid(): # pylint: disable=maybe-no-member
|
||||
errors = serializer.errors # pylint: disable=maybe-no-member
|
||||
if not serializer.is_valid():
|
||||
errors = serializer.errors
|
||||
for key, error in errors.iteritems():
|
||||
field_errors[key] = {
|
||||
'developer_message': u"Value '{field_value}' is not valid for field '{field_name}': {error}".format(
|
||||
|
||||
Reference in New Issue
Block a user