Merge pull request #26277 from edx/py-amnesty-branding

Applied pylint-amnesty to branding
This commit is contained in:
Jawayria
2021-02-02 13:45:46 +05:00
committed by GitHub
8 changed files with 10 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
"""
""" # lint-amnesty, pylint: disable=django-not-configured
EdX Branding package.
Provides a way to retrieve "branded" parts of the site.

View File

@@ -43,7 +43,7 @@ class BrandingInfoConfig(ConfigurationModel):
try:
json.loads(self.configuration)
except ValueError:
raise ValidationError('Must be valid JSON string.')
raise ValidationError('Must be valid JSON string.') # lint-amnesty, pylint: disable=raise-missing-from
@classmethod
def get_config(cls):

View File

@@ -9,7 +9,7 @@ from django.test.utils import override_settings
from django.urls import reverse
from ..api import _footer_business_links, get_footer, get_home_url, get_logo_url
from openedx.core.djangoapps.site_configuration.tests.test_util import with_site_configuration
from openedx.core.djangoapps.site_configuration.tests.test_util import with_site_configuration # lint-amnesty, pylint: disable=wrong-import-order
test_config_disabled_contact_us = { # pylint: disable=invalid-name
"CONTACT_US_ENABLE": False,

View File

@@ -15,7 +15,7 @@ class BrandingInfoConfigTest(TestCase):
"""
def setUp(self):
super(BrandingInfoConfigTest, self).setUp()
super(BrandingInfoConfigTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments
self.configuration_string = """{
"CN": {
"url": "http://www.xuetangx.com",

View File

@@ -44,7 +44,7 @@ class AnonymousIndexPageTest(ModuleStoreTestCase):
Tests that anonymous users can access the '/' page, Need courses with start date
"""
def setUp(self):
super(AnonymousIndexPageTest, self).setUp()
super(AnonymousIndexPageTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments
self.factory = RequestFactory()
self.course = CourseFactory.create(
days_early_for_beta=5,
@@ -161,7 +161,7 @@ class IndexPageCourseCardsSortingTests(ModuleStoreTestCase):
ENABLED_SIGNALS = ['course_published']
def setUp(self):
super(IndexPageCourseCardsSortingTests, self).setUp()
super(IndexPageCourseCardsSortingTests, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments
self.starting_later = CourseFactory.create(
org='MITx',
number='1000',

View File

@@ -8,7 +8,7 @@ import ddt
import mock
import six
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.test import TestCase
from django.urls import reverse
@@ -278,7 +278,7 @@ class TestIndex(SiteMixin, TestCase):
def setUp(self):
""" Set up a user """
super(TestIndex, self).setUp()
super(TestIndex, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments
patcher = mock.patch("common.djangoapps.student.models.tracker")
self.mock_tracker = patcher.start()

View File

@@ -9,7 +9,7 @@ from django.core.cache import cache
from django.db import transaction
from django.http import Http404, HttpResponse
from django.shortcuts import redirect
from django.urls import reverse
from django.urls import reverse # lint-amnesty, pylint: disable=unused-import
from django.urls.exceptions import NoReverseMatch
from django.utils import translation
from django.utils.translation.trans_real import get_supported_language_variant
@@ -309,7 +309,7 @@ def footer(request):
with translation.override(language):
footer_dict = branding_api.get_footer(is_secure=request.is_secure())
cache.set(cache_key, footer_dict, settings.FOOTER_CACHE_TIMEOUT)
return JsonResponse(footer_dict, 200, content_type="application/json; charset=utf-8")
return JsonResponse(footer_dict, 200, content_type="application/json; charset=utf-8") # lint-amnesty, pylint: disable=redundant-content-type-for-json-response
else:
return HttpResponse(status=406)