fix tests
This commit is contained in:
@@ -378,7 +378,8 @@ def award_course_certificate(self, username, course_run_key, certificate_availab
|
||||
|
||||
# Date is being passed via JSON and is encoded in the EMCA date time string format. The rest of the code
|
||||
# expects a datetime.
|
||||
certificate_available_date = datetime.strptime(certificate_available_date, VISIBLE_DATE_FORMAT)
|
||||
if certificate_available_date:
|
||||
certificate_available_date = datetime.strptime(certificate_available_date, VISIBLE_DATE_FORMAT)
|
||||
|
||||
# Even in the cases where this task is called with a certificate_available_date, we still need to retrieve
|
||||
# the course overview because it's required to determine if we should use the certificate_available_date or
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
"""
|
||||
This module contains tests for programs-related signals and signal handlers.
|
||||
"""
|
||||
|
||||
import datetime
|
||||
|
||||
import mock
|
||||
from django.test import TestCase
|
||||
from opaque_keys.edx.keys import CourseKey
|
||||
|
||||
from common.djangoapps.student.tests.factories import UserFactory
|
||||
from openedx.core.djangoapps.programs.signals import (
|
||||
handle_course_cert_awarded,
|
||||
handle_course_cert_changed,
|
||||
@@ -20,7 +22,6 @@ from openedx.core.djangoapps.signals.signals import (
|
||||
)
|
||||
from openedx.core.djangoapps.site_configuration.tests.factories import SiteConfigurationFactory
|
||||
from openedx.core.djangolib.testing.utils import skip_unless_lms
|
||||
from common.djangoapps.student.tests.factories import UserFactory
|
||||
|
||||
TEST_USERNAME = 'test-user'
|
||||
TEST_COURSE_KEY = CourseKey.from_string('course-v1:edX+test_course+1')
|
||||
@@ -252,6 +253,7 @@ class CourseCertAvailableDateChangedReceiverTest(TestCase):
|
||||
return {
|
||||
'sender': self.__class__,
|
||||
'course_key': TEST_COURSE_KEY,
|
||||
'available_date': datetime.datetime.now()
|
||||
}
|
||||
|
||||
def test_signal_received(self, mock_enable_update, mock_is_learner_issuance_enabled, mock_task): # pylint: disable=unused-argument
|
||||
|
||||
Reference in New Issue
Block a user