Commit 425239a5 by Jillian Vogel

Disables Enterprise Integration feature by default

Moves ENABLE_ENTERPRISE_INTEGRATION to settings.FEATURES,
and changes the default value to False.
parent 725edbbc
...@@ -924,8 +924,8 @@ class EnrollmentTest(EnrollmentTestMixin, ModuleStoreTestCase, APITestCase, Ente ...@@ -924,8 +924,8 @@ class EnrollmentTest(EnrollmentTestMixin, ModuleStoreTestCase, APITestCase, Ente
self.assertEqual(course_mode, updated_mode) self.assertEqual(course_mode, updated_mode)
@httpretty.activate @httpretty.activate
@override_settings(ENTERPRISE_SERVICE_WORKER_USERNAME='enterprise_worker') @override_settings(ENTERPRISE_SERVICE_WORKER_USERNAME='enterprise_worker',
@override_settings(ENABLE_ENTERPRISE_INTEGRATION=True) FEATURES=dict(ENABLE_ENTERPRISE_INTEGRATION=True))
def test_enterprise_course_enrollment_with_ec_uuid(self): def test_enterprise_course_enrollment_with_ec_uuid(self):
"""Verify that the enrollment completes when the EnterpriseCourseEnrollment creation succeeds. """ """Verify that the enrollment completes when the EnterpriseCourseEnrollment creation succeeds. """
UserFactory.create( UserFactory.create(
......
...@@ -52,7 +52,6 @@ def fake_support_backend_values(name, default=None): # pylint: disable=unused-a ...@@ -52,7 +52,6 @@ def fake_support_backend_values(name, default=None): # pylint: disable=unused-a
ZENDESK_USER="dummy", ZENDESK_USER="dummy",
ZENDESK_API_KEY="dummy", ZENDESK_API_KEY="dummy",
ZENDESK_CUSTOM_FIELDS={}, ZENDESK_CUSTOM_FIELDS={},
ENABLE_ENTERPRISE_INTEGRATION=False
) )
@mock.patch("util.views.dog_stats_api") @mock.patch("util.views.dog_stats_api")
@mock.patch("util.views._ZendeskApi", autospec=True) @mock.patch("util.views._ZendeskApi", autospec=True)
...@@ -463,7 +462,8 @@ class SubmitFeedbackTest(EnterpriseServiceMockMixin, TestCase): ...@@ -463,7 +462,8 @@ class SubmitFeedbackTest(EnterpriseServiceMockMixin, TestCase):
("course-v1:testOrg+testCourseNumber+testCourseRun", False), ("course-v1:testOrg+testCourseNumber+testCourseRun", False),
) )
@unpack @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): 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. Test a valid request from an authenticated user with enterprise tags.
...@@ -521,7 +521,8 @@ class SubmitFeedbackTest(EnterpriseServiceMockMixin, TestCase): ...@@ -521,7 +521,8 @@ class SubmitFeedbackTest(EnterpriseServiceMockMixin, TestCase):
self._assert_datadog_called(datadog_mock, datadog_tags) self._assert_datadog_called(datadog_mock, datadog_tags)
@httpretty.activate @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): 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. Test tags related to enterprise should not be there in case an unauthenticated user.
...@@ -545,7 +546,8 @@ class SubmitFeedbackTest(EnterpriseServiceMockMixin, TestCase): ...@@ -545,7 +546,8 @@ class SubmitFeedbackTest(EnterpriseServiceMockMixin, TestCase):
self.assertNotEqual(datadog_mock.mock_calls, not_expected_datadog_calls) self.assertNotEqual(datadog_mock.mock_calls, not_expected_datadog_calls)
@httpretty.activate @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): 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. Test tags related to enterprise should be there in case the request is generated by an authenticated user.
......
...@@ -194,7 +194,6 @@ class FieldOverridePerformanceTestCase(FieldOverrideTestMixin, ProceduralCourseT ...@@ -194,7 +194,6 @@ class FieldOverridePerformanceTestCase(FieldOverrideTestMixin, ProceduralCourseT
@override_settings( @override_settings(
XBLOCK_FIELD_DATA_WRAPPERS=[], XBLOCK_FIELD_DATA_WRAPPERS=[],
MODULESTORE_FIELD_OVERRIDE_PROVIDERS=[], MODULESTORE_FIELD_OVERRIDE_PROVIDERS=[],
ENABLE_ENTERPRISE_INTEGRATION=False,
) )
def test_field_overrides(self, overrides, course_width, enable_ccx, view_as_ccx): def test_field_overrides(self, overrides, course_width, enable_ccx, view_as_ccx):
""" """
......
...@@ -348,7 +348,7 @@ class CourseInfoTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase): ...@@ -348,7 +348,7 @@ class CourseInfoTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
@attr(shard=1) @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): class SelfPacedCourseInfoTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase):
""" """
Tests for the info page of self-paced courses. Tests for the info page of self-paced courses.
......
...@@ -1202,7 +1202,6 @@ class StartDateTests(ModuleStoreTestCase): ...@@ -1202,7 +1202,6 @@ class StartDateTests(ModuleStoreTestCase):
# pylint: disable=protected-access, no-member # pylint: disable=protected-access, no-member
@attr(shard=1) @attr(shard=1)
@override_settings(ENABLE_ENTERPRISE_INTEGRATION=False)
class ProgressPageBaseTests(ModuleStoreTestCase): class ProgressPageBaseTests(ModuleStoreTestCase):
""" """
Base class for progress page tests. Base class for progress page tests.
......
...@@ -448,7 +448,7 @@ class SingleThreadQueryCountTestCase(ForumsEnableMixin, ModuleStoreTestCase): ...@@ -448,7 +448,7 @@ class SingleThreadQueryCountTestCase(ForumsEnableMixin, ModuleStoreTestCase):
""" """
Call single_thread and assert that it returns what we expect. 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( response = views.single_thread(
request, request,
course.id.to_deprecated_string(), course.id.to_deprecated_string(),
......
...@@ -406,6 +406,9 @@ FEATURES = { ...@@ -406,6 +406,9 @@ FEATURES = {
# Whether course goals is enabled. # Whether course goals is enabled.
'ENABLE_COURSE_GOALS': True, '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 # 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 = { ...@@ -3265,6 +3268,8 @@ HELP_TOKENS_BOOKS = {
# However, for all intents and purposes this service is treated as a standalone IDA. # 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 # These configuration settings are specific to the Enterprise service and you should
# not find references to them within the edx-platform project. # 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_ENROLLMENT_API_URL = LMS_ROOT_URL + LMS_ENROLLMENT_API_PATH
ENTERPRISE_PUBLIC_ENROLLMENT_API_URL = ENTERPRISE_ENROLLMENT_API_URL ENTERPRISE_PUBLIC_ENROLLMENT_API_URL = ENTERPRISE_ENROLLMENT_API_URL
......
...@@ -20,7 +20,6 @@ ECOMMERCE_API_URL = 'http://edx.devstack.ecommerce:18130/api/v2' ...@@ -20,7 +20,6 @@ ECOMMERCE_API_URL = 'http://edx.devstack.ecommerce:18130/api/v2'
COMMENTS_SERVICE_URL = 'http://edx.devstack.forum:4567' COMMENTS_SERVICE_URL = 'http://edx.devstack.forum:4567'
ENTERPRISE_API_URL = '{}/enterprise/api/v1/'.format(LMS_ROOT_URL) ENTERPRISE_API_URL = '{}/enterprise/api/v1/'.format(LMS_ROOT_URL)
ENABLE_ENTERPRISE_INTEGRATION = False
CREDENTIALS_INTERNAL_SERVICE_URL = 'http://edx.devstack.credentials:18150' CREDENTIALS_INTERNAL_SERVICE_URL = 'http://edx.devstack.credentials:18150'
CREDENTIALS_PUBLIC_SERVICE_URL = 'http://localhost:18150' CREDENTIALS_PUBLIC_SERVICE_URL = 'http://localhost:18150'
...@@ -39,7 +38,8 @@ FEATURES.update({ ...@@ -39,7 +38,8 @@ FEATURES.update({
'ENABLE_COURSE_DISCOVERY': False, 'ENABLE_COURSE_DISCOVERY': False,
'ENABLE_DASHBOARD_SEARCH': False, 'ENABLE_DASHBOARD_SEARCH': False,
'ENABLE_DISCUSSION_SERVICE': True, '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) ENABLE_MKTG_SITE = os.environ.get('ENABLE_MARKETING_SITE', False)
......
...@@ -601,7 +601,6 @@ COMPREHENSIVE_THEME_LOCALE_PATHS = [REPO_ROOT / "themes/conf/locale", ] ...@@ -601,7 +601,6 @@ COMPREHENSIVE_THEME_LOCALE_PATHS = [REPO_ROOT / "themes/conf/locale", ]
LMS_ROOT_URL = "http://localhost:8000" LMS_ROOT_URL = "http://localhost:8000"
ENABLE_ENTERPRISE_INTEGRATION = False
ECOMMERCE_API_URL = 'https://ecommerce.example.com/api/v2/' ECOMMERCE_API_URL = 'https://ecommerce.example.com/api/v2/'
ENTERPRISE_API_URL = 'http://enterprise.example.com/enterprise/api/v1/' ENTERPRISE_API_URL = 'http://enterprise.example.com/enterprise/api/v1/'
ENTERPRISE_CONSENT_API_URL = 'http://enterprise.example.com/consent/api/v1/' ENTERPRISE_CONSENT_API_URL = 'http://enterprise.example.com/consent/api/v1/'
......
...@@ -322,7 +322,7 @@ def enterprise_enabled(): ...@@ -322,7 +322,7 @@ def enterprise_enabled():
""" """
Determines whether the Enterprise app is installed Determines whether the Enterprise app is installed
""" """
return 'enterprise' in settings.INSTALLED_APPS and getattr(settings, 'ENABLE_ENTERPRISE_INTEGRATION', True) return 'enterprise' in settings.INSTALLED_APPS and settings.FEATURES.get('ENABLE_ENTERPRISE_INTEGRATION', False)
def enterprise_customer_uuid_for_request(request): def enterprise_customer_uuid_for_request(request):
......
...@@ -31,6 +31,10 @@ from openedx.features.enterprise_support.utils import get_cache_key ...@@ -31,6 +31,10 @@ from openedx.features.enterprise_support.utils import get_cache_key
from student.tests.factories import UserFactory 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): class MockEnrollment(mock.MagicMock):
""" """
Mock object for an enrollment which has a consistent string representation Mock object for an enrollment which has a consistent string representation
...@@ -41,7 +45,7 @@ class MockEnrollment(mock.MagicMock): ...@@ -41,7 +45,7 @@ class MockEnrollment(mock.MagicMock):
@ddt.ddt @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') @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
class TestEnterpriseApi(EnterpriseServiceMockMixin, CacheIsolationTestCase): class TestEnterpriseApi(EnterpriseServiceMockMixin, CacheIsolationTestCase):
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment