Skip to content

Commit 7b98079

Browse files
Sameen FatimaSameen Fatima
authored andcommitted
fix: fixed tests and quality failures
1 parent f572079 commit 7b98079

File tree

5 files changed

+32
-27
lines changed

5 files changed

+32
-27
lines changed

openedx/core/djangoapps/user_api/accounts/tests/test_retirement_views.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
EnterpriseCustomerUser,
2323
PendingEnterpriseCustomerUser
2424
)
25-
# This is a temporary import path while we transition from integrated_channels to channel_integrations
26-
if getattr(settings, 'ENABLE_LEGACY_INTEGRATED_CHANNELS', True):
27-
from integrated_channels.sap_success_factors.models import SapSuccessFactorsLearnerDataTransmissionAudit
28-
else:
29-
from channel_integrations.sap_success_factors.models import SapSuccessFactorsLearnerDataTransmissionAudit
3025
from opaque_keys.edx.keys import CourseKey
3126
from rest_framework import status
3227
from social_django.models import UserSocialAuth
@@ -92,6 +87,12 @@
9287
setup_retirement_states
9388
)
9489

90+
# This is a temporary import path while we transition from integrated_channels to channel_integrations
91+
if getattr(settings, 'ENABLE_LEGACY_INTEGRATED_CHANNELS', True):
92+
from integrated_channels.sap_success_factors.models import SapSuccessFactorsLearnerDataTransmissionAudit
93+
else:
94+
from channel_integrations.sap_success_factors.models import SapSuccessFactorsLearnerDataTransmissionAudit
95+
9596

9697
def build_jwt_headers(user):
9798
"""

openedx/core/djangoapps/user_api/accounts/views.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,6 @@
2626
from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication
2727
from edx_rest_framework_extensions.auth.session.authentication import SessionAuthenticationAllowInactiveUser
2828
from enterprise.models import EnterpriseCourseEnrollment, EnterpriseCustomerUser, PendingEnterpriseCustomerUser
29-
# This is a temporary import path while we transition from integrated_channels to channel_integrations
30-
if getattr(settings, 'ENABLE_LEGACY_INTEGRATED_CHANNELS', True):
31-
from integrated_channels.degreed.models import DegreedLearnerDataTransmissionAudit
32-
from integrated_channels.sap_success_factors.models import SapSuccessFactorsLearnerDataTransmissionAudit
33-
else:
34-
from channel_integrations.degreed2.models import Degreed2LearnerDataTransmissionAudit as DegreedLearnerDataTransmissionAudit
35-
from channel_integrations.sap_success_factors.models import SapSuccessFactorsLearnerDataTransmissionAudit
3629
from rest_framework import permissions, status
3730
from rest_framework.authentication import SessionAuthentication
3831
from rest_framework.exceptions import UnsupportedMediaType
@@ -102,6 +95,15 @@
10295
from .signals import USER_RETIRE_LMS_CRITICAL, USER_RETIRE_LMS_MISC, USER_RETIRE_MAILINGS
10396
from .utils import create_retirement_request_and_deactivate_account, username_suffix_generator
10497

98+
# This is a temporary import path while we transition from integrated_channels to channel_integrations
99+
if getattr(settings, 'ENABLE_LEGACY_INTEGRATED_CHANNELS', True):
100+
from integrated_channels.degreed.models import DegreedLearnerDataTransmissionAudit
101+
from integrated_channels.sap_success_factors.models import SapSuccessFactorsLearnerDataTransmissionAudit
102+
else:
103+
from channel_integrations.degreed2.models import Degreed2LearnerDataTransmissionAudit \
104+
as DegreedLearnerDataTransmissionAudit
105+
from channel_integrations.sap_success_factors.models import SapSuccessFactorsLearnerDataTransmissionAudit
106+
105107
log = logging.getLogger(__name__)
106108

107109
USER_PROFILE_PII = {

openedx/core/djangoapps/user_api/management/commands/create_user_gdpr_testing.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919
EnterpriseCustomerUser,
2020
PendingEnterpriseCustomerUser
2121
)
22-
# This is a temporary import path while we transition from integrated_channels to channel_integrations
23-
if getattr(settings, 'ENABLE_LEGACY_INTEGRATED_CHANNELS', True):
24-
from integrated_channels.sap_success_factors.models import SapSuccessFactorsLearnerDataTransmissionAudit
25-
else:
26-
from channel_integrations.sap_success_factors.models import SapSuccessFactorsLearnerDataTransmissionAudit
2722
from opaque_keys.edx.keys import CourseKey
2823
from zoneinfo import ZoneInfo
2924

@@ -36,6 +31,12 @@
3631

3732
from ...models import UserOrgTag
3833

34+
# This is a temporary import path while we transition from integrated_channels to channel_integrations
35+
if getattr(settings, 'ENABLE_LEGACY_INTEGRATED_CHANNELS', True):
36+
from integrated_channels.sap_success_factors.models import SapSuccessFactorsLearnerDataTransmissionAudit
37+
else:
38+
from channel_integrations.sap_success_factors.models import SapSuccessFactorsLearnerDataTransmissionAudit
39+
3940

4041
class Command(BaseCommand):
4142
"""

openedx/features/enterprise_support/signals.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
from django.db.models.signals import post_save, pre_save
1111
from django.dispatch import receiver
1212
from enterprise.models import EnterpriseCourseEnrollment, EnterpriseCustomer
13+
from slumber.exceptions import HttpClientError
14+
15+
from common.djangoapps.student.signals import UNENROLL_DONE
16+
from openedx.core.djangoapps.commerce.utils import ecommerce_api_client
17+
from openedx.core.djangoapps.signals.signals import COURSE_ASSESSMENT_GRADE_CHANGED, COURSE_GRADE_NOW_PASSED
18+
from openedx.features.enterprise_support.tasks import clear_enterprise_customer_data_consent_share_cache
19+
from openedx.features.enterprise_support.utils import clear_data_consent_share_cache, is_enterprise_learner
20+
1321
# This is a temporary import path while we transition from integrated_channels to channel_integrations
1422
if getattr(settings, 'ENABLE_LEGACY_INTEGRATED_CHANNELS', True):
1523
from integrated_channels.integrated_channel.tasks import (
@@ -21,13 +29,6 @@
2129
transmit_single_learner_data,
2230
transmit_single_subsection_learner_data
2331
)
24-
from slumber.exceptions import HttpClientError
25-
26-
from common.djangoapps.student.signals import UNENROLL_DONE
27-
from openedx.core.djangoapps.commerce.utils import ecommerce_api_client
28-
from openedx.core.djangoapps.signals.signals import COURSE_ASSESSMENT_GRADE_CHANGED, COURSE_GRADE_NOW_PASSED
29-
from openedx.features.enterprise_support.tasks import clear_enterprise_customer_data_consent_share_cache
30-
from openedx.features.enterprise_support.utils import clear_data_consent_share_cache, is_enterprise_learner
3132

3233
log = logging.getLogger(__name__)
3334

openedx/features/enterprise_support/tests/test_signals.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ def test_handle_enterprise_learner_passing_grade(self):
197197
Test to assert transmit_single_learner_data is called when COURSE_GRADE_NOW_PASSED signal is fired
198198
"""
199199
with patch(
200-
'integrated_channels.integrated_channel.tasks.transmit_single_subsection_learner_data.apply_async'
200+
'integrated_channels.integrated_channel.tasks.transmit_single_learner_data.apply_async'
201201
if getattr(settings, 'ENABLE_LEGACY_INTEGRATED_CHANNELS', True) else
202-
'channel_integrations.integrated_channel.tasks.transmit_single_subsection_learner_data.apply_async',
202+
'channel_integrations.integrated_channel.tasks.transmit_single_learner_data.apply_async',
203203
return_value=None
204204
) as mock_task_apply:
205205
course_key = CourseKey.from_string(self.course_id)
@@ -221,7 +221,7 @@ def test_handle_enterprise_learner_subsection(self):
221221
Test to assert transmit_subsection_learner_data is called when COURSE_ASSESSMENT_GRADE_CHANGED signal is fired.
222222
"""
223223
with patch(
224-
'integrated_channels.integrated_channel.tasks.transmit_single_subsection_learner_data.apply_async'
224+
'integrated_channels.integrated_channel.tasks.transmit_single_subsection_learner_data.apply_async'
225225
if getattr(settings, 'ENABLE_LEGACY_INTEGRATED_CHANNELS', True) else
226226
'channel_integrations.integrated_channel.tasks.transmit_single_subsection_learner_data.apply_async',
227227
return_value=None

0 commit comments

Comments
 (0)