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
56b7b700
Commit
56b7b700
authored
Oct 20, 2015
by
jsa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update from ecommerce-api-client 1.1 to edx-rest-api-client 1.2
parent
62633560
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
20 deletions
+20
-20
docs/en_us/platform_api/source/conf.py
+3
-3
lms/djangoapps/commerce/__init__.py
+9
-9
lms/djangoapps/commerce/api/v0/tests/test_views.py
+1
-1
lms/djangoapps/commerce/api/v0/views.py
+1
-1
lms/djangoapps/commerce/signals.py
+1
-1
lms/djangoapps/commerce/tests/__init__.py
+3
-3
lms/djangoapps/verify_student/views.py
+1
-1
requirements/edx/base.txt
+1
-0
requirements/edx/github.txt
+0
-1
No files found.
docs/en_us/platform_api/source/conf.py
View file @
56b7b700
...
...
@@ -186,10 +186,10 @@ MOCK_MODULES = [
'xmodule.course_module'
,
'user_api.accounts.api'
,
'user_api.accounts.serializers'
,
'e
commerce
_api_client'
,
'e
dx_rest
_api_client'
,
'client'
,
'e
commerce
_api_client.client'
,
'e
commerce
_api_client.exceptions'
,
'e
dx_rest
_api_client.client'
,
'e
dx_rest
_api_client.exceptions'
,
'student.auth'
,
'ccx_keys'
,
'ccx_keys.locator'
,
...
...
lms/djangoapps/commerce/__init__.py
View file @
56b7b700
""" Commerce app. """
from
django.conf
import
settings
from
e
commerce_api_client.client
import
Ecommerce
ApiClient
from
e
dx_rest_api_client.client
import
EdxRest
ApiClient
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
E
commerce
ApiClient
(
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
E
dxRest
ApiClient
(
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
...
...
lms/djangoapps/commerce/api/v0/tests/test_views.py
View file @
56b7b700
...
...
@@ -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
e
commerce
_api_client
import
exceptions
from
e
dx_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
...
...
lms/djangoapps/commerce/api/v0/views.py
View file @
56b7b700
""" API v0 views. """
import
logging
from
e
commerce
_api_client
import
exceptions
from
e
dx_rest
_api_client
import
exceptions
from
opaque_keys
import
InvalidKeyError
from
opaque_keys.edx.keys
import
CourseKey
from
rest_framework.authentication
import
SessionAuthentication
...
...
lms/djangoapps/commerce/signals.py
View file @
56b7b700
...
...
@@ -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
e
commerce
_api_client.exceptions
import
HttpClientError
from
e
dx_rest
_api_client.exceptions
import
HttpClientError
import
requests
from
microsite_configuration
import
microsite
...
...
lms/djangoapps/commerce/tests/__init__.py
View file @
56b7b700
...
...
@@ -11,7 +11,7 @@ import httpretty
import
jwt
import
mock
from
e
commerce
_api_client
import
auth
from
e
dx_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
E
commerce
ApiClientTest
(
TestCase
):
class
E
dxRest
ApiClientTest
(
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
(
E
commerce
ApiClientTest
,
self
)
.
setUp
()
super
(
E
dxRest
ApiClientTest
,
self
)
.
setUp
()
self
.
user
=
UserFactory
()
self
.
user
.
email
=
self
.
TEST_USER_EMAIL
...
...
lms/djangoapps/verify_student/views.py
View file @
56b7b700
...
...
@@ -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
e
commerce
_api_client.exceptions
import
SlumberBaseException
from
e
dx_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
...
...
requirements/edx/base.txt
View file @
56b7b700
...
...
@@ -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
...
...
requirements/edx/github.txt
View file @
56b7b700
...
...
@@ -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
...
...
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