Commit 8a620640 by jsa

Disable credentials-related settings/tests under cms.

parent d8084564
...@@ -849,9 +849,6 @@ INSTALLED_APPS = ( ...@@ -849,9 +849,6 @@ INSTALLED_APPS = (
# Microsite configuration application # Microsite configuration application
'microsite_configuration', 'microsite_configuration',
# Credentials support
'openedx.core.djangoapps.credentials',
# edx-milestones service # edx-milestones service
'milestones', 'milestones',
...@@ -1129,8 +1126,3 @@ USERNAME_PATTERN = r'(?P<username>[\w.@+-]+)' ...@@ -1129,8 +1126,3 @@ USERNAME_PATTERN = r'(?P<username>[\w.@+-]+)'
# Partner support link for CMS footer # Partner support link for CMS footer
PARTNER_SUPPORT_EMAIL = '' PARTNER_SUPPORT_EMAIL = ''
################################ Settings for Credentials Service ################################
CREDENTIALS_SERVICE_USERNAME = 'credentials_service_user'
"""Tests for models supporting Credentials-related functionality.""" """Tests for models supporting Credentials-related functionality."""
import unittest
from django.conf import settings
from django.test import TestCase from django.test import TestCase
from openedx.core.djangoapps.credentials.tests.mixins import CredentialsApiConfigMixin from openedx.core.djangoapps.credentials.tests.mixins import CredentialsApiConfigMixin
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
class TestCredentialsApiConfig(CredentialsApiConfigMixin, TestCase): class TestCredentialsApiConfig(CredentialsApiConfigMixin, TestCase):
"""Tests covering the CredentialsApiConfig model.""" """Tests covering the CredentialsApiConfig model."""
def test_url_construction(self): def test_url_construction(self):
......
"""Tests covering Credentials utilities.""" """Tests covering Credentials utilities."""
import unittest
from django.conf import settings
from django.core.cache import cache from django.core.cache import cache
from django.test import TestCase from django.test import TestCase
import httpretty import httpretty
...@@ -15,6 +18,7 @@ from openedx.core.djangoapps.programs.models import ProgramsApiConfig ...@@ -15,6 +18,7 @@ from openedx.core.djangoapps.programs.models import ProgramsApiConfig
from student.tests.factories import UserFactory from student.tests.factories import UserFactory
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
class TestCredentialsRetrieval(ProgramsApiConfigMixin, CredentialsApiConfigMixin, CredentialsDataMixin, class TestCredentialsRetrieval(ProgramsApiConfigMixin, CredentialsApiConfigMixin, CredentialsDataMixin,
ProgramsDataMixin, TestCase): ProgramsDataMixin, TestCase):
""" Tests covering the retrieval of user credentials from the Credentials """ Tests covering the retrieval of user credentials from the Credentials
......
...@@ -9,6 +9,7 @@ from edx_rest_api_client.client import EdxRestApiClient ...@@ -9,6 +9,7 @@ from edx_rest_api_client.client import EdxRestApiClient
import httpretty import httpretty
import json import json
import mock import mock
import unittest
from oauth2_provider.tests.factories import ClientFactory from oauth2_provider.tests.factories import ClientFactory
from openedx.core.djangoapps.credentials.tests.mixins import CredentialsApiConfigMixin from openedx.core.djangoapps.credentials.tests.mixins import CredentialsApiConfigMixin
...@@ -20,6 +21,7 @@ from student.tests.factories import UserFactory ...@@ -20,6 +21,7 @@ from student.tests.factories import UserFactory
TASKS_MODULE = 'openedx.core.djangoapps.programs.tasks.v1.tasks' TASKS_MODULE = 'openedx.core.djangoapps.programs.tasks.v1.tasks'
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
class GetApiClientTestCase(TestCase, ProgramsApiConfigMixin): class GetApiClientTestCase(TestCase, ProgramsApiConfigMixin):
""" """
Test the get_api_client function Test the get_api_client function
...@@ -44,6 +46,7 @@ class GetApiClientTestCase(TestCase, ProgramsApiConfigMixin): ...@@ -44,6 +46,7 @@ class GetApiClientTestCase(TestCase, ProgramsApiConfigMixin):
self.assertEqual(api_client._store['session'].auth.token, 'test-token') # pylint: disable=protected-access self.assertEqual(api_client._store['session'].auth.token, 'test-token') # pylint: disable=protected-access
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
class GetCompletedCoursesTestCase(TestCase): class GetCompletedCoursesTestCase(TestCase):
""" """
Test the get_completed_courses function Test the get_completed_courses function
...@@ -87,6 +90,7 @@ class GetCompletedCoursesTestCase(TestCase): ...@@ -87,6 +90,7 @@ class GetCompletedCoursesTestCase(TestCase):
]) ])
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
class GetCompletedProgramsTestCase(TestCase): class GetCompletedProgramsTestCase(TestCase):
""" """
Test the get_completed_programs function Test the get_completed_programs function
...@@ -113,6 +117,7 @@ class GetCompletedProgramsTestCase(TestCase): ...@@ -113,6 +117,7 @@ class GetCompletedProgramsTestCase(TestCase):
self.assertEqual(result, [1, 2, 3]) self.assertEqual(result, [1, 2, 3])
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
class GetAwardedCertificateProgramsTestCase(TestCase): class GetAwardedCertificateProgramsTestCase(TestCase):
""" """
Test the get_awarded_certificate_programs function Test the get_awarded_certificate_programs function
...@@ -153,6 +158,7 @@ class GetAwardedCertificateProgramsTestCase(TestCase): ...@@ -153,6 +158,7 @@ class GetAwardedCertificateProgramsTestCase(TestCase):
self.assertEqual(result, [1]) self.assertEqual(result, [1])
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
class AwardProgramCertificateTestCase(TestCase): class AwardProgramCertificateTestCase(TestCase):
""" """
Test the award_program_certificate function Test the award_program_certificate function
...@@ -181,6 +187,7 @@ class AwardProgramCertificateTestCase(TestCase): ...@@ -181,6 +187,7 @@ class AwardProgramCertificateTestCase(TestCase):
self.assertEqual(json.loads(httpretty.last_request().body), expected_body) self.assertEqual(json.loads(httpretty.last_request().body), expected_body)
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
@ddt.ddt @ddt.ddt
@mock.patch(TASKS_MODULE + '.award_program_certificate') @mock.patch(TASKS_MODULE + '.award_program_certificate')
@mock.patch(TASKS_MODULE + '.get_awarded_certificate_programs') @mock.patch(TASKS_MODULE + '.get_awarded_certificate_programs')
......
"""Tests covering Programs utilities.""" """Tests covering Programs utilities."""
import unittest
from django.conf import settings
from django.core.cache import cache from django.core.cache import cache
from django.test import TestCase from django.test import TestCase
import httpretty import httpretty
...@@ -15,6 +18,7 @@ from openedx.core.djangoapps.programs.utils import ( ...@@ -15,6 +18,7 @@ from openedx.core.djangoapps.programs.utils import (
from student.tests.factories import UserFactory from student.tests.factories import UserFactory
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
class TestProgramRetrieval(ProgramsApiConfigMixin, ProgramsDataMixin, class TestProgramRetrieval(ProgramsApiConfigMixin, ProgramsDataMixin,
CredentialsApiConfigMixin, TestCase): CredentialsApiConfigMixin, TestCase):
"""Tests covering the retrieval of programs from the Programs service.""" """Tests covering the retrieval of programs from the Programs service."""
......
"""Tests covering Api utils.""" """Tests covering Api utils."""
import unittest
from django.conf import settings
from django.core.cache import cache from django.core.cache import cache
from django.test import TestCase from django.test import TestCase
import httpretty import httpretty
...@@ -95,6 +97,8 @@ class TestApiDataRetrieval(CredentialsApiConfigMixin, CredentialsDataMixin, Prog ...@@ -95,6 +97,8 @@ class TestApiDataRetrieval(CredentialsApiConfigMixin, CredentialsDataMixin, Prog
) )
self.assertEqual(actual, []) self.assertEqual(actual, [])
# this test is skipped under cms because the credentials app is only installed under LMS.
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
@httpretty.activate @httpretty.activate
def test_get_edx_api_data_multiple_page(self): def test_get_edx_api_data_multiple_page(self):
"""Verify that all data is retrieve for multiple page response.""" """Verify that all data is retrieve for multiple page response."""
......
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