Commit 56b7b700 by jsa

Update from ecommerce-api-client 1.1 to edx-rest-api-client 1.2

parent 62633560
......@@ -186,10 +186,10 @@ MOCK_MODULES = [
'xmodule.course_module',
'user_api.accounts.api',
'user_api.accounts.serializers',
'ecommerce_api_client',
'edx_rest_api_client',
'client',
'ecommerce_api_client.client',
'ecommerce_api_client.exceptions',
'edx_rest_api_client.client',
'edx_rest_api_client.exceptions',
'student.auth',
'ccx_keys',
'ccx_keys.locator',
......
""" Commerce app. """
from django.conf import settings
from ecommerce_api_client.client import EcommerceApiClient
from edx_rest_api_client.client import EdxRestApiClient
from eventtracking import tracker
......@@ -26,14 +26,14 @@ def is_commerce_service_configured():
def ecommerce_api_client(user):
""" Returns an E-Commerce API client setup with authentication for the specified user. """
return EcommerceApiClient(settings.ECOMMERCE_API_URL,
settings.ECOMMERCE_API_SIGNING_KEY,
user.username,
user.profile.name,
user.email,
tracking_context=create_tracking_context(user),
issuer=settings.JWT_ISSUER,
expires_in=settings.JWT_EXPIRATION)
return EdxRestApiClient(settings.ECOMMERCE_API_URL,
settings.ECOMMERCE_API_SIGNING_KEY,
user.username,
user.profile.name,
user.email,
tracking_context=create_tracking_context(user),
issuer=settings.JWT_ISSUER,
expires_in=settings.JWT_EXPIRATION)
# this is here to support registering the signals in signals.py
......
......@@ -18,7 +18,7 @@ from commerce.tests import TEST_BASKET_ID, TEST_ORDER_NUMBER, TEST_PAYMENT_DATA,
from commerce.tests.mocks import mock_basket_order, mock_create_basket
from commerce.tests.test_views import UserMixin
from course_modes.models import CourseMode
from ecommerce_api_client import exceptions
from edx_rest_api_client import exceptions
from embargo.test_utils import restrict_course
from enrollment.api import get_enrollment
from openedx.core.lib.django_test_client_utils import get_absolute_url
......
""" API v0 views. """
import logging
from ecommerce_api_client import exceptions
from edx_rest_api_client import exceptions
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from rest_framework.authentication import SessionAuthentication
......
......@@ -9,7 +9,7 @@ from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.dispatch import receiver
from django.utils.translation import ugettext as _
from ecommerce_api_client.exceptions import HttpClientError
from edx_rest_api_client.exceptions import HttpClientError
import requests
from microsite_configuration import microsite
......
......@@ -11,7 +11,7 @@ import httpretty
import jwt
import mock
from ecommerce_api_client import auth
from edx_rest_api_client import auth
from commerce import ecommerce_api_client
from student.tests.factories import UserFactory
......@@ -29,14 +29,14 @@ TEST_PAYMENT_DATA = {
@override_settings(ECOMMERCE_API_SIGNING_KEY=TEST_API_SIGNING_KEY, ECOMMERCE_API_URL=TEST_API_URL)
class EcommerceApiClientTest(TestCase):
class EdxRestApiClientTest(TestCase):
""" Tests to ensure the client is initialized properly. """
TEST_USER_EMAIL = 'test@example.com'
TEST_CLIENT_ID = 'test-client-id'
def setUp(self):
super(EcommerceApiClientTest, self).setUp()
super(EdxRestApiClientTest, self).setUp()
self.user = UserFactory()
self.user.email = self.TEST_USER_EMAIL
......
......@@ -33,7 +33,7 @@ from commerce import ecommerce_api_client
from commerce.utils import audit_log
from course_modes.models import CourseMode
from courseware.url_helpers import get_redirect_url
from ecommerce_api_client.exceptions import SlumberBaseException
from edx_rest_api_client.exceptions import SlumberBaseException
from edxmako.shortcuts import render_to_response, render_to_string
from embargo import api as embargo_api
from microsite_configuration import microsite
......
......@@ -30,6 +30,7 @@ django-storages==1.1.5
django-method-override==0.1.0
djangorestframework>=3.1,<3.2
django==1.4.22
edx-rest-api-client==1.2.0
elasticsearch==0.4.5
facebook-sdk==0.4.0
feedparser==5.1.3
......
......@@ -54,7 +54,6 @@ git+https://github.com/edx/edx-lint.git@v0.2.9#egg=edx_lint==0.2.9
-e git+https://github.com/edx/xblock-utils.git@213a97a50276d6a2504d8133650b2930ead357a0#egg=xblock-utils
-e git+https://github.com/edx-solutions/xblock-google-drive.git@138e6fa0bf3a2013e904a085b9fed77dab7f3f21#egg=xblock-google-drive
git+https://github.com/edx/edx-reverification-block.git@0.0.4#egg=edx-reverification-block==0.0.4
git+https://github.com/edx/ecommerce-api-client.git@1.1.0#egg=ecommerce-api-client==1.1.0
-e git+https://github.com/edx/edx-user-state-client.git@30c0ad4b9f57f8d48d6943eb585ec8a9205f4469#egg=edx-user-state-client
git+https://github.com/edx/edx-organizations.git@release-2015-09-22#egg=edx-organizations==0.1.6
git+https://github.com/edx/edx-proctoring.git@0.9.16#egg=edx-proctoring==0.9.16
......
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