Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
1b63bd9c
Commit
1b63bd9c
authored
Oct 23, 2017
by
Jillian Vogel
Committed by
GitHub
Oct 23, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16155 from open-craft/jill/enable_enterprise_integration
Lets ENABLE_ENTERPRISE_INTEGRATION be configurable
parents
160dba95
425239a5
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
23 additions
and
15 deletions
+23
-15
common/djangoapps/enrollment/tests/test_views.py
+2
-2
common/djangoapps/util/tests/test_submit_feedback.py
+6
-4
lms/djangoapps/ccx/tests/test_field_override_performance.py
+0
-1
lms/djangoapps/courseware/tests/test_course_info.py
+1
-1
lms/djangoapps/courseware/tests/test_views.py
+0
-1
lms/djangoapps/discussion/tests/test_views.py
+1
-1
lms/envs/common.py
+5
-0
lms/envs/devstack_docker.py
+2
-2
lms/envs/test.py
+0
-1
openedx/features/enterprise_support/api.py
+1
-1
openedx/features/enterprise_support/tests/test_api.py
+5
-1
No files found.
common/djangoapps/enrollment/tests/test_views.py
View file @
1b63bd9c
...
...
@@ -924,8 +924,8 @@ class EnrollmentTest(EnrollmentTestMixin, ModuleStoreTestCase, APITestCase, Ente
self
.
assertEqual
(
course_mode
,
updated_mode
)
@httpretty.activate
@override_settings
(
ENTERPRISE_SERVICE_WORKER_USERNAME
=
'enterprise_worker'
)
@override_settings
(
ENABLE_ENTERPRISE_INTEGRATION
=
True
)
@override_settings
(
ENTERPRISE_SERVICE_WORKER_USERNAME
=
'enterprise_worker'
,
FEATURES
=
dict
(
ENABLE_ENTERPRISE_INTEGRATION
=
True
)
)
def
test_enterprise_course_enrollment_with_ec_uuid
(
self
):
"""Verify that the enrollment completes when the EnterpriseCourseEnrollment creation succeeds. """
UserFactory
.
create
(
...
...
common/djangoapps/util/tests/test_submit_feedback.py
View file @
1b63bd9c
...
...
@@ -52,7 +52,6 @@ def fake_support_backend_values(name, default=None): # pylint: disable=unused-a
ZENDESK_USER
=
"dummy"
,
ZENDESK_API_KEY
=
"dummy"
,
ZENDESK_CUSTOM_FIELDS
=
{},
ENABLE_ENTERPRISE_INTEGRATION
=
False
)
@mock.patch
(
"util.views.dog_stats_api"
)
@mock.patch
(
"util.views._ZendeskApi"
,
autospec
=
True
)
...
...
@@ -463,7 +462,8 @@ class SubmitFeedbackTest(EnterpriseServiceMockMixin, TestCase):
(
"course-v1:testOrg+testCourseNumber+testCourseRun"
,
False
),
)
@unpack
@override_settings
(
ZENDESK_CUSTOM_FIELDS
=
TEST_ZENDESK_CUSTOM_FIELD_CONFIG
,
ENABLE_ENTERPRISE_INTEGRATION
=
True
)
@override_settings
(
ZENDESK_CUSTOM_FIELDS
=
TEST_ZENDESK_CUSTOM_FIELD_CONFIG
)
@mock.patch.dict
(
"django.conf.settings.FEATURES"
,
dict
(
ENABLE_ENTERPRISE_INTEGRATION
=
True
))
def
test_valid_request_auth_user_with_enterprise_info
(
self
,
course_id
,
enrolled
,
zendesk_mock_class
,
datadog_mock
):
"""
Test a valid request from an authenticated user with enterprise tags.
...
...
@@ -521,7 +521,8 @@ class SubmitFeedbackTest(EnterpriseServiceMockMixin, TestCase):
self
.
_assert_datadog_called
(
datadog_mock
,
datadog_tags
)
@httpretty.activate
@override_settings
(
ZENDESK_CUSTOM_FIELDS
=
TEST_ZENDESK_CUSTOM_FIELD_CONFIG
,
ENABLE_ENTERPRISE_INTEGRATION
=
True
)
@override_settings
(
ZENDESK_CUSTOM_FIELDS
=
TEST_ZENDESK_CUSTOM_FIELD_CONFIG
)
@mock.patch.dict
(
"django.conf.settings.FEATURES"
,
dict
(
ENABLE_ENTERPRISE_INTEGRATION
=
True
))
def
test_request_with_anonymous_user_without_enterprise_info
(
self
,
zendesk_mock_class
,
datadog_mock
):
"""
Test tags related to enterprise should not be there in case an unauthenticated user.
...
...
@@ -545,7 +546,8 @@ class SubmitFeedbackTest(EnterpriseServiceMockMixin, TestCase):
self
.
assertNotEqual
(
datadog_mock
.
mock_calls
,
not_expected_datadog_calls
)
@httpretty.activate
@override_settings
(
ZENDESK_CUSTOM_FIELDS
=
TEST_ZENDESK_CUSTOM_FIELD_CONFIG
,
ENABLE_ENTERPRISE_INTEGRATION
=
True
)
@override_settings
(
ZENDESK_CUSTOM_FIELDS
=
TEST_ZENDESK_CUSTOM_FIELD_CONFIG
)
@mock.patch.dict
(
"django.conf.settings.FEATURES"
,
dict
(
ENABLE_ENTERPRISE_INTEGRATION
=
True
))
def
test_tags_in_request_with_auth_user_with_enterprise_info
(
self
,
zendesk_mock_class
,
datadog_mock
):
"""
Test tags related to enterprise should be there in case the request is generated by an authenticated user.
...
...
lms/djangoapps/ccx/tests/test_field_override_performance.py
View file @
1b63bd9c
...
...
@@ -194,7 +194,6 @@ class FieldOverridePerformanceTestCase(FieldOverrideTestMixin, ProceduralCourseT
@override_settings
(
XBLOCK_FIELD_DATA_WRAPPERS
=
[],
MODULESTORE_FIELD_OVERRIDE_PROVIDERS
=
[],
ENABLE_ENTERPRISE_INTEGRATION
=
False
,
)
def
test_field_overrides
(
self
,
overrides
,
course_width
,
enable_ccx
,
view_as_ccx
):
"""
...
...
lms/djangoapps/courseware/tests/test_course_info.py
View file @
1b63bd9c
...
...
@@ -348,7 +348,7 @@ class CourseInfoTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
@attr
(
shard
=
1
)
@override_settings
(
FEATURES
=
dict
(
settings
.
FEATURES
,
EMBARGO
=
False
)
,
ENABLE_ENTERPRISE_INTEGRATION
=
False
)
@override_settings
(
FEATURES
=
dict
(
settings
.
FEATURES
,
EMBARGO
=
False
))
class
SelfPacedCourseInfoTestCase
(
LoginEnrollmentTestCase
,
SharedModuleStoreTestCase
):
"""
Tests for the info page of self-paced courses.
...
...
lms/djangoapps/courseware/tests/test_views.py
View file @
1b63bd9c
...
...
@@ -1202,7 +1202,6 @@ class StartDateTests(ModuleStoreTestCase):
# pylint: disable=protected-access, no-member
@attr
(
shard
=
1
)
@override_settings
(
ENABLE_ENTERPRISE_INTEGRATION
=
False
)
class
ProgressPageBaseTests
(
ModuleStoreTestCase
):
"""
Base class for progress page tests.
...
...
lms/djangoapps/discussion/tests/test_views.py
View file @
1b63bd9c
...
...
@@ -448,7 +448,7 @@ class SingleThreadQueryCountTestCase(ForumsEnableMixin, ModuleStoreTestCase):
"""
Call single_thread and assert that it returns what we expect.
"""
with
override_settings
(
ENABLE_ENTERPRISE_INTEGRATION
=
enterprise_enabled
):
with
patch
.
dict
(
"django.conf.settings.FEATURES"
,
dict
(
ENABLE_ENTERPRISE_INTEGRATION
=
enterprise_enabled
)
):
response
=
views
.
single_thread
(
request
,
course
.
id
.
to_deprecated_string
(),
...
...
lms/envs/common.py
View file @
1b63bd9c
...
...
@@ -406,6 +406,9 @@ FEATURES = {
# Whether course goals is enabled.
'ENABLE_COURSE_GOALS'
:
True
,
# Set to enable Enterprise integration
'ENABLE_ENTERPRISE_INTEGRATION'
:
False
,
}
# Settings for the course reviews tool template and identification key, set either to None to disable course reviews
...
...
@@ -3265,6 +3268,8 @@ HELP_TOKENS_BOOKS = {
# However, for all intents and purposes this service is treated as a standalone IDA.
# These configuration settings are specific to the Enterprise service and you should
# not find references to them within the edx-platform project.
#
# Only used if FEATURES['ENABLE_ENTERPRISE_INTEGRATION'] == True.
ENTERPRISE_ENROLLMENT_API_URL
=
LMS_ROOT_URL
+
LMS_ENROLLMENT_API_PATH
ENTERPRISE_PUBLIC_ENROLLMENT_API_URL
=
ENTERPRISE_ENROLLMENT_API_URL
...
...
lms/envs/devstack_docker.py
View file @
1b63bd9c
...
...
@@ -20,7 +20,6 @@ ECOMMERCE_API_URL = 'http://edx.devstack.ecommerce:18130/api/v2'
COMMENTS_SERVICE_URL
=
'http://edx.devstack.forum:4567'
ENTERPRISE_API_URL
=
'{}/enterprise/api/v1/'
.
format
(
LMS_ROOT_URL
)
ENABLE_ENTERPRISE_INTEGRATION
=
False
CREDENTIALS_INTERNAL_SERVICE_URL
=
'http://edx.devstack.credentials:18150'
CREDENTIALS_PUBLIC_SERVICE_URL
=
'http://localhost:18150'
...
...
@@ -39,7 +38,8 @@ FEATURES.update({
'ENABLE_COURSE_DISCOVERY'
:
False
,
'ENABLE_DASHBOARD_SEARCH'
:
False
,
'ENABLE_DISCUSSION_SERVICE'
:
True
,
'SHOW_HEADER_LANGUAGE_SELECTOR'
:
True
'SHOW_HEADER_LANGUAGE_SELECTOR'
:
True
,
'ENABLE_ENTERPRISE_INTEGRATION'
:
False
,
})
ENABLE_MKTG_SITE
=
os
.
environ
.
get
(
'ENABLE_MARKETING_SITE'
,
False
)
...
...
lms/envs/test.py
View file @
1b63bd9c
...
...
@@ -601,7 +601,6 @@ COMPREHENSIVE_THEME_LOCALE_PATHS = [REPO_ROOT / "themes/conf/locale", ]
LMS_ROOT_URL
=
"http://localhost:8000"
ENABLE_ENTERPRISE_INTEGRATION
=
False
ECOMMERCE_API_URL
=
'https://ecommerce.example.com/api/v2/'
ENTERPRISE_API_URL
=
'http://enterprise.example.com/enterprise/api/v1/'
ENTERPRISE_CONSENT_API_URL
=
'http://enterprise.example.com/consent/api/v1/'
...
...
openedx/features/enterprise_support/api.py
View file @
1b63bd9c
...
...
@@ -322,7 +322,7 @@ def enterprise_enabled():
"""
Determines whether the Enterprise app is installed
"""
return
'enterprise'
in
settings
.
INSTALLED_APPS
and
getattr
(
settings
,
'ENABLE_ENTERPRISE_INTEGRATION'
,
Tru
e
)
return
'enterprise'
in
settings
.
INSTALLED_APPS
and
settings
.
FEATURES
.
get
(
'ENABLE_ENTERPRISE_INTEGRATION'
,
Fals
e
)
def
enterprise_customer_uuid_for_request
(
request
):
...
...
openedx/features/enterprise_support/tests/test_api.py
View file @
1b63bd9c
...
...
@@ -31,6 +31,10 @@ from openedx.features.enterprise_support.utils import get_cache_key
from
student.tests.factories
import
UserFactory
FEATURES_WITH_ENTERPRISE_ENABLED
=
settings
.
FEATURES
.
copy
()
FEATURES_WITH_ENTERPRISE_ENABLED
[
'ENABLE_ENTERPRISE_INTEGRATION'
]
=
True
class
MockEnrollment
(
mock
.
MagicMock
):
"""
Mock object for an enrollment which has a consistent string representation
...
...
@@ -41,7 +45,7 @@ class MockEnrollment(mock.MagicMock):
@ddt.ddt
@override_settings
(
ENABLE_ENTERPRISE_INTEGRATION
=
True
)
@override_settings
(
FEATURES
=
FEATURES_WITH_ENTERPRISE_ENABLED
)
@unittest.skipUnless
(
settings
.
ROOT_URLCONF
==
'lms.urls'
,
'Test only valid in lms'
)
class
TestEnterpriseApi
(
EnterpriseServiceMockMixin
,
CacheIsolationTestCase
):
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment