committed by
Michael Youngstrom
parent
090b8ed011
commit
c2dcbb36b7
@@ -3,7 +3,7 @@ Command for managing commerce configuration for lms.
|
||||
We can use this command to enable/disable commerce configuration or disable checkout to E-Commerce service.
|
||||
"""
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
import logging
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
"""
|
||||
Tests for management command for enabling commerce configuration.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.core.management import call_command
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
""" Commerce app tests package. """
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import httpretty
|
||||
import mock
|
||||
from django.conf import settings
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
""" Factories for generating fake commerce-related data. """
|
||||
from __future__ import absolute_import
|
||||
|
||||
import factory
|
||||
from factory.fuzzy import FuzzyText
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
""" Commerce app tests package. """
|
||||
# pylint: disable=invalid-name
|
||||
from __future__ import absolute_import
|
||||
|
||||
import json
|
||||
|
||||
import httpretty
|
||||
@@ -7,8 +10,6 @@ from django.conf import settings
|
||||
from . import factories
|
||||
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
class mock_ecommerce_api_endpoint(object):
|
||||
"""
|
||||
Base class for contextmanagers used to mock calls to api endpoints.
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
"""
|
||||
Tests for signal handling in commerce djangoapp.
|
||||
"""
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
import base64
|
||||
import json
|
||||
from urlparse import urljoin
|
||||
|
||||
import ddt
|
||||
import httpretty
|
||||
@@ -17,14 +16,16 @@ from django.test import TestCase
|
||||
from django.test.utils import override_settings
|
||||
from opaque_keys.edx.keys import CourseKey
|
||||
from requests import Timeout
|
||||
from six.moves.urllib.parse import urljoin # pylint: disable=import-error
|
||||
|
||||
from course_modes.models import CourseMode
|
||||
from student.signals import REFUND_ORDER
|
||||
from student.tests.factories import CourseEnrollmentFactory, UserFactory
|
||||
|
||||
from ..models import CommerceConfiguration
|
||||
from ..utils import _generate_refund_notification_body, _send_refund_notification, create_zendesk_ticket
|
||||
from . import JSON
|
||||
from .mocks import mock_create_refund, mock_process_refund
|
||||
from ..models import CommerceConfiguration
|
||||
from ..utils import create_zendesk_ticket, _generate_refund_notification_body, _send_refund_notification
|
||||
|
||||
ZENDESK_URL = 'http://zendesk.example.com/'
|
||||
ZENDESK_USER = 'test@example.com'
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""Tests of commerce utilities."""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import json
|
||||
from urllib import urlencode
|
||||
|
||||
import ddt
|
||||
import httpretty
|
||||
@@ -10,9 +11,8 @@ from django.test.client import RequestFactory
|
||||
from django.test.utils import override_settings
|
||||
from mock import patch
|
||||
from opaque_keys.edx.locator import CourseLocator
|
||||
from six.moves.urllib.parse import urlencode # pylint: disable=import-error
|
||||
from waffle.testutils import override_switch
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import CourseFactory
|
||||
|
||||
from course_modes.models import CourseMode
|
||||
from course_modes.tests.factories import CourseModeFactory
|
||||
@@ -21,7 +21,9 @@ from lms.djangoapps.commerce.utils import EcommerceService, refund_entitlement,
|
||||
from openedx.core.djangolib.testing.utils import skip_unless_lms
|
||||
from openedx.core.lib.log_utils import audit_log
|
||||
from student.models import CourseEnrollment
|
||||
from student.tests.factories import (TEST_PASSWORD, UserFactory)
|
||||
from student.tests.factories import TEST_PASSWORD, UserFactory
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import CourseFactory
|
||||
|
||||
# Entitlements is not in CMS' INSTALLED_APPS so these imports will error during test collection
|
||||
if settings.ROOT_URLCONF == 'lms.urls':
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
""" Tests for commerce views. """
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import json
|
||||
|
||||
import ddt
|
||||
|
||||
Reference in New Issue
Block a user