-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into MueezKhan/Removing-Unencrypted-User-Creden…
…tials-Data
- Loading branch information
Showing
16 changed files
with
350 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
Your project description goes here. | ||
""" | ||
|
||
__version__ = "4.9.0" | ||
__version__ = "4.9.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
tests/test_integrated_channels/test_blackboard/test_exporters/test_learner_data.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
""" | ||
Tests for Blackboard learner data exporters. | ||
""" | ||
|
||
import unittest | ||
from unittest import mock | ||
|
||
from pytest import mark | ||
|
||
from integrated_channels.blackboard.exporters.learner_data import BlackboardLearnerExporter | ||
from test_utils import factories | ||
|
||
|
||
@mark.django_db | ||
class TestBlackboardLearnerDataExporter(unittest.TestCase): | ||
""" | ||
Test BlackboardLearnerDataExporter | ||
""" | ||
|
||
def setUp(self): | ||
super().setUp() | ||
self.enterprise_customer = factories.EnterpriseCustomerFactory() | ||
self.enterprise_customer_user = factories.EnterpriseCustomerUserFactory( | ||
enterprise_customer=self.enterprise_customer, | ||
) | ||
self.course_id = 'course-v1:edX+DemoX+DemoCourse' | ||
self.course_key = 'edX+DemoX' | ||
self.config = factories.BlackboardEnterpriseCustomerConfigurationFactory( | ||
enterprise_customer=self.enterprise_customer, | ||
blackboard_base_url='foobar', | ||
client_id='client_id', | ||
client_secret='client_secret', | ||
refresh_token='token', | ||
) | ||
|
||
@mock.patch('enterprise.api_client.discovery.CourseCatalogApiServiceClient') | ||
def test_retrieve_same_learner_data_record(self, mock_course_catalog_api): | ||
""" | ||
If a learner data record already exists for the enrollment, it should be retrieved instead of created. | ||
""" | ||
enterprise_course_enrollment = factories.EnterpriseCourseEnrollmentFactory( | ||
course_id=self.course_id, | ||
enterprise_customer_user=self.enterprise_customer_user, | ||
) | ||
mock_course_catalog_api.return_value.get_course_id.return_value = self.course_key | ||
exporter = BlackboardLearnerExporter('fake-user', self.config) | ||
learner_data_records_1 = exporter.get_learner_data_records(enterprise_course_enrollment)[0] | ||
learner_data_records_1.save() | ||
learner_data_records_2 = exporter.get_learner_data_records(enterprise_course_enrollment)[0] | ||
learner_data_records_2.save() | ||
|
||
assert learner_data_records_1.id == learner_data_records_2.id |
Oops, something went wrong.