feat: update task and signals responsible for cert available dates in Credentials
[APER-3229] The monolith and the Credentials IDA keep independent records of a course runs certificate availability/visibility preferences. This PR aims to improve the communication between the monolith and the Credentiala IDA to keep the availability date/preference in sync with the monoliths records. The current code is too strict and actually prevents valid updates in some configurations. Additionally, the Credentials IDA doesn't understand the concept of "course pacing" (instructor-paced vs self-paced) and has troubles with courses with an availability date of "end". Instead of having to add the concept of course pacing (and syncing more data between the two systems), this PR proposes sending the end date of a course as the "certificate available date" to Credentials. This way, the Credentials IDA can manage the visibility of awarded credentials in a course run with a display behavior of "end" using the existing feature set and models of the Credentials service.
This commit is contained in:
46
openedx/core/djangoapps/credentials/tests/test_api.py
Normal file
46
openedx/core/djangoapps/credentials/tests/test_api.py
Normal file
@@ -0,0 +1,46 @@
|
||||
"""
|
||||
Tests for the utility functions defined as part of the credentials app's public Python API.
|
||||
"""
|
||||
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
from openedx.core.djangoapps.credentials.api import is_credentials_enabled
|
||||
from openedx.core.djangoapps.credentials.models import CredentialsApiConfig
|
||||
from openedx.core.djangoapps.credentials.tests.mixins import CredentialsApiConfigMixin
|
||||
from openedx.core.djangolib.testing.utils import skip_unless_lms
|
||||
|
||||
|
||||
class CredentialsApiTests(CredentialsApiConfigMixin, TestCase):
|
||||
"""
|
||||
Tests for the Public Pyton API exposed by the credentials Django app.
|
||||
"""
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
CredentialsApiConfig.objects.all().delete()
|
||||
|
||||
@skip_unless_lms
|
||||
def test_is_credentials_enabled_config_enabled(self):
|
||||
"""
|
||||
A test that verifies the output of the `is_credentials_enabled` utility function when a CredentialsApiConfig
|
||||
exists and is enabled.
|
||||
"""
|
||||
self.create_credentials_config(enabled=True)
|
||||
assert is_credentials_enabled()
|
||||
|
||||
@skip_unless_lms
|
||||
def test_is_credentials_enabled_config_disabled(self):
|
||||
"""
|
||||
A test that verifies the output of the `is_credentials_enabled` utility function when a CredentialsApiConfig
|
||||
exists and is disabled.
|
||||
"""
|
||||
self.create_credentials_config(enabled=False)
|
||||
assert not is_credentials_enabled()
|
||||
|
||||
@skip_unless_lms
|
||||
def test_is_credentials_enabled_config_absent(self):
|
||||
"""
|
||||
A test that verifies the output of the `is_credentials_enabled` utility function when a CredentialsApiConfig
|
||||
does not exist.
|
||||
"""
|
||||
assert not is_credentials_enabled()
|
||||
Reference in New Issue
Block a user