Skip to content
Snippets Groups Projects
Commit 7ee49390 authored by Awais Qureshi's avatar Awais Qureshi Committed by usamasadiq
Browse files

BOM-2334

Apply pylint-amnesty.
parent 045a3dc2
No related branches found
No related tags found
No related merge requests found
Showing with 17 additions and 14 deletions
......@@ -40,7 +40,7 @@ class TestGlobalAnnouncements(TestCase):
])
def setUp(self):
super(TestGlobalAnnouncements, self).setUp()
super(TestGlobalAnnouncements, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments
self.client = Client()
self.admin = AdminFactory.create(
email='staff@edx.org',
......
"""
""" # lint-amnesty, pylint: disable=django-not-configured
Calendar syncing Course dates with a User.
"""
default_app_config = 'openedx.features.calendar_sync.apps.UserCalendarSyncConfig'
......
# lint-amnesty, pylint: disable=missing-module-docstring
from django.contrib import admin
from .models import UserCalendarSyncConfig
......
......@@ -8,11 +8,11 @@ Define the calendar_sync Django App.
from django.apps import AppConfig
class UserCalendarSyncConfig(AppConfig):
class UserCalendarSyncConfig(AppConfig): # lint-amnesty, pylint: disable=missing-class-docstring
name = 'openedx.features.calendar_sync'
def ready(self):
super(UserCalendarSyncConfig, self).ready()
super(UserCalendarSyncConfig, self).ready() # lint-amnesty, pylint: disable=super-with-arguments
# noinspection PyUnresolvedReferences
import openedx.features.calendar_sync.signals # pylint: disable=import-outside-toplevel,unused-import
......@@ -3,7 +3,7 @@ Models for Calendar Sync
"""
from django.contrib.auth.models import User
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.db import models
from simple_history.models import HistoricalRecords
......
......@@ -13,7 +13,7 @@ from .utils import send_email_with_attachment
@receiver(post_save, sender=UserCalendarSyncConfig)
def handle_calendar_sync_email(sender, instance, created, **kwargs):
def handle_calendar_sync_email(sender, instance, created, **kwargs): # lint-amnesty, pylint: disable=missing-function-docstring, unused-argument
if (
CALENDAR_SYNC_FLAG.is_enabled(instance.course_key) and
RELATIVE_DATES_FLAG.is_enabled(instance.course_key) and
......
# lint-amnesty, pylint: disable=missing-module-docstring
from factory.django import DjangoModelFactory
from openedx.features.calendar_sync.models import UserCalendarSyncConfig
......
......@@ -20,7 +20,7 @@ class TestCalendarSyncAPI(SharedModuleStoreTestCase):
cls.course_key = cls.course.id
def setUp(self):
super(TestCalendarSyncAPI, self).setUp()
super(TestCalendarSyncAPI, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments
self.user = UserFactory(password=TEST_PASSWORD)
def test_subscribe_to_calendar(self):
......
......@@ -12,7 +12,7 @@ TEST_PASSWORD = 'test'
class TestCalendarSyncInit(TestCase):
""" Tests for the contents of __init__.py """
def setUp(self):
super(TestCalendarSyncInit, self).setUp()
super(TestCalendarSyncInit, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments
self.user = UserFactory(password=TEST_PASSWORD)
def test_get_calendar_event_id(self):
......
......@@ -19,7 +19,7 @@ class TestUserCalendarSyncConfig(SharedModuleStoreTestCase):
cls.course_key = cls.course.id
def setUp(self):
super(TestUserCalendarSyncConfig, self).setUp()
super(TestUserCalendarSyncConfig, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments
self.user = UserFactory(password=TEST_PASSWORD)
def test_is_enabled_for_course(self):
......
......@@ -25,7 +25,7 @@ class TestCalendarSyncView(SharedModuleStoreTestCase, TestCase):
cls.course = CourseFactory.create()
def setUp(self):
super(TestCalendarSyncView, self).setUp()
super(TestCalendarSyncView, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments
self.user = self.create_user_for_course(self.course)
self.client.login(username=self.user.username, password=TEST_PASSWORD)
self.calendar_sync_url = reverse('openedx.calendar_sync', args=[self.course.id])
......
# lint-amnesty, pylint: disable=missing-module-docstring
import logging
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
......@@ -5,13 +6,13 @@ from email.mime.text import MIMEText
from django.conf import settings
from django.utils.html import format_html
from django.utils.translation import ugettext_lazy as _
import os
import os # lint-amnesty, pylint: disable=wrong-import-order
import boto3
logger = logging.getLogger(__name__)
def calendar_sync_initial_email_content(course_name):
def calendar_sync_initial_email_content(course_name): # lint-amnesty, pylint: disable=missing-function-docstring
subject = _('Sync {course} to your calendar').format(course=course_name)
body_paragraph_1 = _('Sticking to a schedule is the best way to ensure that you successfully complete your '
'self-paced course. This schedule for {course} will help you stay on track!'
......@@ -28,7 +29,7 @@ def calendar_sync_initial_email_content(course_name):
return subject, body
def calendar_sync_update_email_content(course_name):
def calendar_sync_update_email_content(course_name): # lint-amnesty, pylint: disable=missing-function-docstring
subject = _('{course} dates have been updated on your calendar').format(course=course_name)
body_paragraph = _('You have successfully shifted your course schedule and your calendar is up to date.'
).format(course=course_name)
......@@ -57,7 +58,7 @@ def prepare_attachments(attachment_data, file_ext=''):
return attachments
def send_email_with_attachment(to_emails, attachment_data, course_name, is_initial):
def send_email_with_attachment(to_emails, attachment_data, course_name, is_initial): # lint-amnesty, pylint: disable=missing-function-docstring
# connect to SES
client = boto3.client('ses', region_name=settings.AWS_SES_REGION_NAME)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment