@@ -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',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""
|
||||
""" # lint-amnesty, pylint: disable=django-not-configured
|
||||
Calendar syncing Course dates with a User.
|
||||
"""
|
||||
default_app_config = 'openedx.features.calendar_sync.apps.UserCalendarSyncConfig'
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# 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
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# 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])
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# 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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user