From 8888f27d29eb2eac536ebdd5f969dd30acc91709 Mon Sep 17 00:00:00 2001 From: Christie Rice <8483753+crice100@users.noreply.github.com> Date: Mon, 25 Jan 2021 15:05:22 -0500 Subject: [PATCH] MICROBA-921 Fix typos (#26132) * MICROBA-921 fix typos * Fix quality --- lms/djangoapps/certificates/api.py | 4 ++-- lms/djangoapps/certificates/models.py | 8 ++++---- lms/djangoapps/certificates/signals.py | 2 +- lms/djangoapps/certificates/tests/test_api.py | 4 ++-- lms/djangoapps/certificates/tests/test_queue.py | 16 ++++++++-------- .../certificates/tests/test_support_views.py | 4 ++-- lms/djangoapps/certificates/tests/test_views.py | 2 +- .../certificates/tests/test_webview_views.py | 2 +- lms/djangoapps/certificates/views/webview.py | 2 +- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/lms/djangoapps/certificates/api.py b/lms/djangoapps/certificates/api.py index 8b63fb5e41b..0f7a969050e 100644 --- a/lms/djangoapps/certificates/api.py +++ b/lms/djangoapps/certificates/api.py @@ -229,7 +229,7 @@ def generate_user_certificates(student, course_key, course=None, insecure=False, log.info(message.format(user=student.id, course=course_key)) # If cert_status is not present in certificate valid_statuses (for example unverified) then - # add_cert returns None and raises AttributeError while accesing cert attributes. + # add_cert returns None and raises AttributeError while accessing cert attributes. if cert is None: return @@ -356,7 +356,7 @@ def set_cert_generation_enabled(course_key, is_enabled): certificates for this course. """ - CertificateGenerationCourseSetting.set_self_generatation_enabled_for_course(course_key, is_enabled) + CertificateGenerationCourseSetting.set_self_generation_enabled_for_course(course_key, is_enabled) cert_event_type = 'enabled' if is_enabled else 'disabled' event_name = '.'.join(['edx', 'certificate', 'generation', cert_event_type]) tracker.emit(event_name, { diff --git a/lms/djangoapps/certificates/models.py b/lms/djangoapps/certificates/models.py index 82a79c68c93..fdd15fd4b84 100644 --- a/lms/djangoapps/certificates/models.py +++ b/lms/djangoapps/certificates/models.py @@ -291,7 +291,7 @@ class GeneratedCertificate(models.Model): error_reason = models.CharField(max_length=512, blank=True, default='') # This is necessary because CMS does not install the certificates app, but it - # imports this models code. Simple History will attempt to connect to the installed + # imports this model's code. Simple History will attempt to connect to the installed # model in the certificates app, which will fail. if 'certificates' in apps.app_configs: history = HistoricalRecords() @@ -319,7 +319,7 @@ class GeneratedCertificate(models.Model): Return a set of CourseKeys for which the user has certificates. Sometimes we just want to check if a user has already been issued a - certificate for a given course (e.g. to test refund elibigility). + certificate for a given course (e.g. to test refund eligibility). Instead of checking if `certificate_for_student` returns `None` on each course_id individually, we instead just return a set of all CourseKeys for which this student has certificates all at once. @@ -874,7 +874,7 @@ class ExampleCertificate(TimeStampedModel): This will usually be called either: 1) When an error occurs adding the certificate to the queue. - 2) When we receieve a response from the queue (either error or success). + 2) When we receive a response from the queue (either error or success). If an error occurs, we store the error message; if certificate generation is successful, we store the URL @@ -1014,7 +1014,7 @@ class CertificateGenerationCourseSetting(TimeStampedModel): return latest.self_generation_enabled @classmethod - def set_self_generatation_enabled_for_course(cls, course_key, is_enabled): + def set_self_generation_enabled_for_course(cls, course_key, is_enabled): """Enable or disable self-generated certificates for a course. Arguments: diff --git a/lms/djangoapps/certificates/signals.py b/lms/djangoapps/certificates/signals.py index eb0edf3e4e0..8fa8c9efe9a 100644 --- a/lms/djangoapps/certificates/signals.py +++ b/lms/djangoapps/certificates/signals.py @@ -39,7 +39,7 @@ def _update_cert_settings_on_pacing_change(sender, updated_course_overview, **kw Catches the signal that course pacing has changed and enable/disable the self-generated certificates according to course-pacing. """ - CertificateGenerationCourseSetting.set_self_generatation_enabled_for_course( + CertificateGenerationCourseSetting.set_self_generation_enabled_for_course( updated_course_overview.id, updated_course_overview.self_paced, ) diff --git a/lms/djangoapps/certificates/tests/test_api.py b/lms/djangoapps/certificates/tests/test_api.py index 7bfe45b548c..227d4cf4080 100644 --- a/lms/djangoapps/certificates/tests/test_api.py +++ b/lms/djangoapps/certificates/tests/test_api.py @@ -232,11 +232,11 @@ class CertificateDownloadableStatusTests(WebCertificateTestMixin, ModuleStoreTes @ddt.ddt -class CertificateisInvalid(WebCertificateTestMixin, ModuleStoreTestCase): +class CertificateIsInvalid(WebCertificateTestMixin, ModuleStoreTestCase): """Tests for the `is_certificate_invalid` helper function. """ def setUp(self): - super(CertificateisInvalid, self).setUp() + super().setUp() self.student = UserFactory() self.course = CourseFactory.create( diff --git a/lms/djangoapps/certificates/tests/test_queue.py b/lms/djangoapps/certificates/tests/test_queue.py index f008f4c9718..51326e791c6 100644 --- a/lms/djangoapps/certificates/tests/test_queue.py +++ b/lms/djangoapps/certificates/tests/test_queue.py @@ -294,11 +294,11 @@ class XQueueCertInterfaceAddCertificateTest(ModuleStoreTestCase): def test_regen_cert_with_pdf_certificate(self): """ - Test that regenerating PDF certifcate log warning message and certificate + Test that regenerating a PDF certificate logs a warning message and the certificate status remains unchanged. """ download_url = 'http://www.example.com/certificate.pdf' - # Create an existing verifed enrollment and certificate + # Create an existing verified enrollment and certificate CourseEnrollmentFactory( user=self.user_2, course_id=self.course.id, @@ -314,15 +314,15 @@ class XQueueCertInterfaceAddCertificateTest(ModuleStoreTestCase): download_url=download_url ) - self._assert_pdf_cert_generation_dicontinued_logs(download_url) + self._assert_pdf_cert_generation_discontinued_logs(download_url) def test_add_cert_with_existing_pdf_certificate(self): """ - Test that add certifcate for existing PDF certificate log warning - message and certificate status remains unchanged. + Test that adding a certificate for existing PDF certificates logs a warning + message and the certificate status remains unchanged. """ download_url = 'http://www.example.com/certificate.pdf' - # Create an existing verifed enrollment and certificate + # Create an existing verified enrollment and certificate CourseEnrollmentFactory( user=self.user_2, course_id=self.course.id, @@ -338,9 +338,9 @@ class XQueueCertInterfaceAddCertificateTest(ModuleStoreTestCase): download_url=download_url ) - self._assert_pdf_cert_generation_dicontinued_logs(download_url, add_cert=True) + self._assert_pdf_cert_generation_discontinued_logs(download_url, add_cert=True) - def _assert_pdf_cert_generation_dicontinued_logs(self, download_url, add_cert=False): + def _assert_pdf_cert_generation_discontinued_logs(self, download_url, add_cert=False): """Assert PDF certificate generation discontinued logs.""" with LogCapture(LOGGER.name) as log: if add_cert: diff --git a/lms/djangoapps/certificates/tests/test_support_views.py b/lms/djangoapps/certificates/tests/test_support_views.py index 937eb25b250..971831e6750 100644 --- a/lms/djangoapps/certificates/tests/test_support_views.py +++ b/lms/djangoapps/certificates/tests/test_support_views.py @@ -288,7 +288,7 @@ class CertificateRegenerateTests(CertificateSupportTestCase): self.assertEqual(response.status_code, 403) def test_regenerate_certificate(self): - """Test web certificate regenration.""" + """Test web certificate regeneration.""" self.cert.download_url = '' self.cert.save() @@ -306,7 +306,7 @@ class CertificateRegenerateTests(CertificateSupportTestCase): @patch('lms.djangoapps.certificates.queue.XQueueCertInterface._generate_cert') def test_regenerate_certificate_for_honor_mode(self, mock_generate_cert): - """Test web certificate regenration for the users who have earned the + """Test web certificate regeneration for the users who have earned the certificate in honor mode """ self.cert.mode = 'honor' diff --git a/lms/djangoapps/certificates/tests/test_views.py b/lms/djangoapps/certificates/tests/test_views.py index 39edc36e31c..563c9a56879 100644 --- a/lms/djangoapps/certificates/tests/test_views.py +++ b/lms/djangoapps/certificates/tests/test_views.py @@ -124,7 +124,7 @@ class UpdateExampleCertificateViewTest(CacheIsolationTestCase): response = self.client.post(self.url, data=payload) self.assertEqual(response.status_code, 400) - def test_update_example_cetificate_non_json_param(self): + def test_update_example_certificate_non_json_param(self): payload = { 'xqueue_header': '{/invalid', 'xqueue_body': '{/invalid' diff --git a/lms/djangoapps/certificates/tests/test_webview_views.py b/lms/djangoapps/certificates/tests/test_webview_views.py index c10410bf5f5..f4dc26bdbf5 100644 --- a/lms/djangoapps/certificates/tests/test_webview_views.py +++ b/lms/djangoapps/certificates/tests/test_webview_views.py @@ -558,7 +558,7 @@ class CertificatesViewsTests(CommonCertificatesTestCase, CacheIsolationTestCase) @override_settings(FEATURES=FEATURES_WITH_CERTS_ENABLED) def test_render_certificate_only_for_downloadable_status(self): """ - Tests taht Certificate HTML Web View returns Certificate only if certificate status is 'downloadable', + Tests that Certificate HTML Web View returns Certificate only if certificate status is 'downloadable', for other statuses it should return "Invalid Certificate". """ self._add_course_certificates(count=1, signatory_count=2) diff --git a/lms/djangoapps/certificates/views/webview.py b/lms/djangoapps/certificates/views/webview.py index 5f9afcb479b..363007e4b1f 100644 --- a/lms/djangoapps/certificates/views/webview.py +++ b/lms/djangoapps/certificates/views/webview.py @@ -223,7 +223,7 @@ def _update_context_with_basic_info(context, course_id, platform_name, configura context['company_contact_urltext'] = _(u"Contact {platform_name}").format(platform_name=platform_name) - # Translators: This text appears near the top of the certficate and describes the guarantee provided by edX + # Translators: This text appears near the top of the certificate and describes the guarantee provided by edX context['document_banner'] = _(u"{platform_name} acknowledges the following student accomplishment").format( platform_name=platform_name ) -- GitLab