Skip to content

Commit

Permalink
Update quality threshold counts (openedx#20681)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbowman authored May 24, 2019
1 parent fdc785b commit f9929f3
Show file tree
Hide file tree
Showing 23 changed files with 57 additions and 102 deletions.
2 changes: 1 addition & 1 deletion cms/djangoapps/maintenance/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def post(self, request):
self.context['msg'] = _('Force publishing course is not supported with old mongo courses.')
log.warning(
u'Force publishing course is not supported with old mongo courses. \
%s attempted to force publish the course %s.', # pylint: disable=unicode-format-string
%s attempted to force publish the course %s.',
request.user,
course_id,
exc_info=True
Expand Down
6 changes: 3 additions & 3 deletions common/djangoapps/third_party_auth/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ class SAMLProviderConfig(ProviderConfig):
'For advanced use cases, enter a JSON object with addtional configuration. '
'The tpa-saml backend supports {"requiredEntitlements": ["urn:..."]}, ' # pylint: disable=unicode-format-string
'which can be used to require the presence of a specific eduPersonEntitlement, '
'and {"extra_field_definitions": [{"name": "...", "urn": "..."},...]}, which can be ' # pylint: disable=unicode-format-string,line-too-long
'and {"extra_field_definitions": [{"name": "...", "urn": "..."},...]}, which can be ' # pylint: disable=unicode-format-string
'used to define registration form fields and the URNs that can be used to retrieve '
'the relevant values from the SAML response. Custom provider types, as selected '
'in the "Identity Provider Type" field, may make use of the information stored '
Expand Down Expand Up @@ -709,7 +709,7 @@ def get_config(self):
data = SAMLProviderData.current(self.entity_id)
if not data or not data.is_valid():
log.error(
'No SAMLProviderData found for provider "%s" with entity id "%s" and IdP slug "%s". ' # pylint: disable=unicode-format-string,line-too-long
'No SAMLProviderData found for provider "%s" with entity id "%s" and IdP slug "%s". ' # pylint: disable=unicode-format-string
'Run "manage.py saml pull" to fix or debug.',
self.name, self.entity_id, self.slug
)
Expand Down Expand Up @@ -824,7 +824,7 @@ class LTIProviderConfig(ProviderConfig):
'tool consumer instance should know this value. '
'For increased security, you can avoid storing this in '
'your database by leaving this field blank and setting '
'SOCIAL_AUTH_LTI_CONSUMER_SECRETS = {"consumer key": "secret", ...} ' # pylint: disable=unicode-format-string,line-too-long
'SOCIAL_AUTH_LTI_CONSUMER_SECRETS = {"consumer key": "secret", ...} ' # pylint: disable=unicode-format-string
'in your instance\'s Django setttigs (or lms.auth.json)'
),
blank=True,
Expand Down
4 changes: 1 addition & 3 deletions common/djangoapps/third_party_auth/tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
class SettingsUnitTest(testutil.TestCase):
"""Unit tests for settings management code."""

# Allow access to protected methods (or module-protected methods) under test.
# pylint: disable=protected-access
# Suppress sprurious no-member warning on fakes.
# Suppress spurious no-member warning on fakes.
# pylint: disable=no-member

def setUp(self):
Expand Down
7 changes: 4 additions & 3 deletions common/test/acceptance/tests/lms/test_progress_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
progress page.
"""
from __future__ import absolute_import
from six.moves import range

from contextlib import contextmanager

import ddt
from six.moves import range

from ...fixtures.course import CourseFixture, XBlockFixtureDesc
from ...pages.common.logout import LogoutPage
Expand Down Expand Up @@ -346,7 +347,7 @@ def test_axis_a11y(self):
# Verify that y-Axis labels are aria-hidden
self.assertEqual(['100%', 'true'], self.progress_page.y_tick_label(0))
self.assertEqual(['0%', 'true'], self.progress_page.y_tick_label(1))
self.assertEqual(['Pass 50%', 'true'], self.progress_page.y_tick_label(2)) # pylint: disable=unicode-format-string,line-too-long
self.assertEqual(['Pass 50%', 'true'], self.progress_page.y_tick_label(2)) # pylint: disable=unicode-format-string
# Verify x-Axis labels and sr-text
self._check_tick_text(0, [u'Homework 1 - Test Subsection 1 - 50% (1/2)'], u'HW 01')

Expand Down Expand Up @@ -407,7 +408,7 @@ def test_axis_a11y(self):

# Verify the overall score. The first element in the array is the sr-only text, and the
# second is the total text (including the sr-only text).
self.assertEqual(['Overall Score', 'Overall Score\n2%'], self.progress_page.graph_overall_score()) # pylint: disable=unicode-format-string,line-too-long
self.assertEqual(['Overall Score', 'Overall Score\n2%'], self.progress_page.graph_overall_score()) # pylint: disable=unicode-format-string


class ProgressPageA11yTest(ProgressPageBaseTest):
Expand Down
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@
'MySQLdb',
'contracts',
'django_mysql',
'lettuce',
'pymongo',
]

Expand Down
11 changes: 7 additions & 4 deletions lms/djangoapps/courseware/tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from django.test.client import Client, RequestFactory
from django.urls import reverse
from django.utils.timezone import now
from django.utils.translation import get_language
from six import text_type

from courseware.access import has_access
Expand Down Expand Up @@ -173,7 +172,11 @@ def setup_user(self):
self.user = self.activate_user(self.email)
self.login(self.email, self.password)

def assert_request_status_code(self, status_code, url, method="GET", **kwargs): # pylint: disable=unicode-format-string
def assert_request_status_code(self, status_code, url, method="GET", **kwargs):
"""
Make a request to the specified URL and verify that it returns the
expected status code.
"""
make_request = getattr(self.client, method.lower())
response = make_request(url, **kwargs)
self.assertEqual(
Expand All @@ -192,7 +195,7 @@ def assert_account_activated(self, url, method="GET", **kwargs):
message_list = list(messages.get_messages(response.wsgi_request))
self.assertEqual(len(message_list), 1)
self.assertIn("success", message_list[0].tags)
self.assertTrue("You have activated your account." in message_list[0].message)
self.assertIn("You have activated your account.", message_list[0].message)

# ============ User creation and login ==============

Expand Down Expand Up @@ -224,7 +227,7 @@ def create_account(self, username, email, password):
'terms_of_service': 'true',
'honor_code': 'true',
}
resp = self.assert_request_status_code(200, url, method="POST", data=request_data)
self.assert_request_status_code(200, url, method="POST", data=request_data)
# Check both that the user is created, and inactive
user = User.objects.get(email=email)
self.assertFalse(user.is_active)
Expand Down
1 change: 0 additions & 1 deletion lms/djangoapps/courseware/tests/test_entrance_exam.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,6 @@ def answer_entrance_exam_problem(course, request, problem, user=None, value=1, m
course,
depth=2
)
# pylint: disable=protected-access
module = get_module(
user,
request,
Expand Down
18 changes: 10 additions & 8 deletions lms/djangoapps/courseware/tests/test_module_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from mock import MagicMock, Mock, patch
from opaque_keys.edx.asides import AsideUsageKeyV2
from opaque_keys.edx.keys import CourseKey, UsageKey
from openedx.core.djangoapps.oauth_dispatch.jwt import create_jwt_for_user
from pyquery import PyQuery
from six import text_type
from web_fragments.fragment import Fragment
Expand Down Expand Up @@ -59,6 +58,7 @@
from lms.djangoapps.courseware.field_overrides import OverrideFieldData
from openedx.core.djangoapps.credit.api import set_credit_requirement_status, set_credit_requirements
from openedx.core.djangoapps.credit.models import CreditCourse
from openedx.core.djangoapps.oauth_dispatch.jwt import create_jwt_for_user
from openedx.core.lib.courses import course_image_url
from openedx.core.lib.gating import api as gating_api
from openedx.core.lib.url_utils import quote_slashes
Expand Down Expand Up @@ -1072,12 +1072,12 @@ def test_toc_toy_from_section(self, default_ms, setup_finds, setup_sends, toc_fi
@ddt.ddt
@patch.dict('django.conf.settings.FEATURES', {'ENABLE_SPECIAL_EXAMS': True})
class TestProctoringRendering(SharedModuleStoreTestCase):
"""Check the Table of Contents for a course"""
@classmethod
def setUpClass(cls):
super(TestProctoringRendering, cls).setUpClass()
cls.course_key = ToyCourseFactory.create().id

"""Check the Table of Contents for a course"""
def setUp(self):
"""
Set up the initial mongo datastores
Expand Down Expand Up @@ -1408,6 +1408,10 @@ def _find_section(self, toc, chapter_url_name, section_url_name):


class TestGatedSubsectionRendering(SharedModuleStoreTestCase, MilestonesTestCaseMixin):
"""
Test the toc for a course is rendered correctly when there is gated content
"""

@classmethod
def setUpClass(cls):
super(TestGatedSubsectionRendering, cls).setUpClass()
Expand All @@ -1416,9 +1420,6 @@ def setUpClass(cls):
cls.course.save()
cls.store.update_item(cls.course, 0)

"""
Test the toc for a course is rendered correctly when there is gated content
"""
def setUp(self):
"""
Set up the initial test data
Expand Down Expand Up @@ -1538,7 +1539,8 @@ def test_xmodule_display_wrapper_disabled(self):
)
result_fragment = module.render(STUDENT_VIEW)

self.assertNotIn('div class="xblock xblock-student_view xmodule_display xmodule_HtmlModule"', result_fragment.content)
self.assertNotIn('div class="xblock xblock-student_view xmodule_display xmodule_HtmlModule"',
result_fragment.content)

def test_static_link_rewrite(self):
module = render.get_module(
Expand Down Expand Up @@ -2163,7 +2165,7 @@ def get_module_for_user(self, user):
field_data_cache = FieldDataCache.cache_for_descriptor_descendents(
self.course.id, user, self.course, depth=2)

return render.get_module( # pylint: disable=protected-access
return render.get_module(
user,
mock_request,
self.problem.location,
Expand Down Expand Up @@ -2236,7 +2238,7 @@ def get_module_for_user(self, user, item=None):
if item is None:
item = self.lti

return render.get_module( # pylint: disable=protected-access
return render.get_module(
user,
mock_request,
item.location,
Expand Down
1 change: 0 additions & 1 deletion lms/djangoapps/courseware/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1922,7 +1922,6 @@ def answer_problem(self, value=1, max_value=1):
depth=2
)
self.addCleanup(set_current_request, None)
# pylint: disable=protected-access
module = get_module(
self.user,
get_mock_request(self.user),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pylint: disable=missing-docstring,relative-import
# pylint: disable=missing-docstring
# This import registers the ForumThreadViewedEventTransformer
from __future__ import absolute_import

Expand Down
Empty file.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion lms/djangoapps/grades/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ def answer_problem(course, request, problem, score=1, max_value=1):
course,
depth=2
)
# pylint: disable=protected-access
module = get_module(
user,
request,
Expand Down
15 changes: 10 additions & 5 deletions lms/djangoapps/shoppingcart/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,8 @@ def test_course_does_not_exist_in_cart_against_valid_reg_code(self):

resp = self.client.post(reverse('shoppingcart.views.use_code'), {'code': self.reg_code})
self.assertEqual(resp.status_code, 404)
self.assertIn(u"Code '{0}' is not valid for any course in the shopping cart.".format(self.reg_code), resp.content)
self.assertIn(u"Code '{0}' is not valid for any course in the shopping cart.".format(self.reg_code),
resp.content)

def test_cart_item_qty_greater_than_1_against_valid_reg_code(self):
course_key = text_type(self.course_key)
Expand Down Expand Up @@ -727,7 +728,7 @@ def test_coupon_discount_for_multiple_courses_in_cart(self, info_log):
self.assertEqual(resp.status_code, 200)
self.assertEquals(self.cart.orderitem_set.count(), 1)
info_log.assert_called_with(
'Coupon "%s" redemption entry removed for user "%s" for order item "%s"', # pylint: disable=unicode-format-string,line-too-long
'Coupon "%s" redemption entry removed for user "%s" for order item "%s"', # pylint: disable=unicode-format-string
self.coupon_code,
self.user,
str(reg_item.id)
Expand All @@ -740,7 +741,8 @@ def test_delete_certificate_item(self, info_log):
cert_item = CertificateItem.add_to_order(self.cart, self.verified_course_key, self.cost, 'honor')
self.assertEquals(self.cart.orderitem_set.count(), 2)

# Delete the discounted item, corresponding coupon redemption should be removed for that particular discounted item
# Delete the discounted item, corresponding coupon redemption
# should be removed for that particular discounted item
resp = self.client.post(reverse('shoppingcart.views.remove_item', args=[]),
{'id': cert_item.id})

Expand Down Expand Up @@ -1253,7 +1255,8 @@ def test_show_receipt_success_with_order_type_business(self):
self.assertIn('FirstNameTesting123', resp.content)
self.assertIn('80.00', resp.content)
# check for the enrollment codes content
self.assertIn('Please send each professional one of these unique registration codes to enroll into the course.', resp.content)
self.assertIn('Please send each professional one of these unique registration codes to enroll into the course.',
resp.content)

# fetch the newly generated registration codes
course_registration_codes = CourseRegistrationCode.objects.filter(order=self.cart)
Expand Down Expand Up @@ -2141,7 +2144,9 @@ def test_report_csv_get(self):
def test_report_csv_bad_date(self):
self.login_user()
self.add_to_download_group(self.user)
response = self.client.post(reverse('payment_csv_report'), {'start_date': 'BAD', 'end_date': 'BAD', 'requested_report': 'itemized_purchase_report'})
response = self.client.post(reverse('payment_csv_report'),
{'start_date': 'BAD', 'end_date': 'BAD',
'requested_report': 'itemized_purchase_report'})

((template, context), unused_kwargs) = render_mock.call_args
self.assertEqual(template, 'shoppingcart/download_report.html')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def handle(self, *args, **options):
else:
log.fatal(
u"simulate_publish should be run as a CMS (Studio) " +
u"command, not %s (override with --force-lms).", # pylint: disable=unicode-format-string
u"command, not %s (override with --force-lms).",
os.environ.get('SERVICE_VARIANT')
)
sys.exit(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ def handle(self, *args, **options):
if not (course_keys or options['start_date'] or options['end_date']):
raise CommandError('You must specify a filter (e.g. --courses= or --start-date)')

# pylint: disable=no-member
certs = get_recently_modified_certificates(course_keys, options['start_date'], options['end_date'])
grades = get_recently_modified_grades(course_keys, options['start_date'], options['end_date'])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers


def configuration_context(request): # pylint: disable=unused-argument
def configuration_context(request):
"""
Configuration context for django templates.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
import traceback
from datetime import datetime, timedelta

import six.moves.urllib.parse
import six.moves.urllib.parse # pylint: disable=import-error
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand, CommandError
from django.utils.html import escapejs
from edx_rest_api_client.client import EdxRestApiClient
from slumber.exceptions import HttpClientError, HttpServerError

from openedx.core.djangoapps.site_configuration.models import SiteConfiguration
from student.models import UserAttribute, UserProfile
from student.models import UserAttribute
from util.query import use_read_replica_if_available

HUBSPOT_API_BASE_URL = 'https://api.hubapi.com'
Expand Down
2 changes: 1 addition & 1 deletion pavelib/paver_tests/test_paver_quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from ddt import ddt, file_data, data, unpack
from mock import MagicMock, mock_open, patch
from path import Path as path
from paver.easy import BuildFailure # pylint: disable=ungrouped-imports
from paver.easy import BuildFailure

import pavelib.quality
from pavelib.paver_tests.utils import fail_on_eslint
Expand Down
Loading

0 comments on commit f9929f3

Please sign in to comment.