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
f9ce8264
Commit
f9ce8264
authored
Jul 07, 2015
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8803 from edx/clintonb/commerce-api-fix
Corrected path to Commerce API
parents
47002ff7
5d356d29
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
lms/djangoapps/commerce/api/v1/tests/test_views.py
+5
-5
lms/djangoapps/commerce/urls.py
+0
-1
lms/urls.py
+2
-0
No files found.
lms/djangoapps/commerce/api/v1/tests/test_views.py
View file @
f9ce8264
...
...
@@ -41,7 +41,7 @@ class CourseApiViewTestMixin(object):
class
CourseListViewTests
(
CourseApiViewTestMixin
,
ModuleStoreTestCase
):
""" Tests for CourseListView. """
path
=
reverse
(
'commerce
:
api:v1:courses:list'
)
path
=
reverse
(
'commerce
_
api:v1:courses:list'
)
def
test_authentication_required
(
self
):
""" Verify only authenticated users can access the view. """
...
...
@@ -72,7 +72,7 @@ class CourseRetrieveUpdateViewTests(CourseApiViewTestMixin, ModuleStoreTestCase)
def
setUp
(
self
):
super
(
CourseRetrieveUpdateViewTests
,
self
)
.
setUp
()
self
.
path
=
reverse
(
'commerce
:
api:v1:courses:retrieve_update'
,
args
=
[
unicode
(
self
.
course
.
id
)])
self
.
path
=
reverse
(
'commerce
_
api:v1:courses:retrieve_update'
,
args
=
[
unicode
(
self
.
course
.
id
)])
self
.
user
=
UserFactory
.
create
()
self
.
client
.
login
(
username
=
self
.
user
.
username
,
password
=
PASSWORD
)
...
...
@@ -103,7 +103,7 @@ class CourseRetrieveUpdateViewTests(CourseApiViewTestMixin, ModuleStoreTestCase)
def
test_retrieve_invalid_course
(
self
):
""" The view should return HTTP 404 when retrieving data for a course that does not exist. """
path
=
reverse
(
'commerce
:
api:v1:courses:retrieve_update'
,
args
=
[
'a/b/c'
])
path
=
reverse
(
'commerce
_
api:v1:courses:retrieve_update'
,
args
=
[
'a/b/c'
])
response
=
self
.
client
.
get
(
path
,
content_type
=
JSON_CONTENT_TYPE
)
self
.
assertEqual
(
response
.
status_code
,
404
)
...
...
@@ -134,7 +134,7 @@ class CourseRetrieveUpdateViewTests(CourseApiViewTestMixin, ModuleStoreTestCase)
u'modes'
:
[
self
.
_serialize_course_mode
(
CourseMode
(
mode_slug
=
u'credit'
,
min_price
=
500
,
currency
=
u'USD'
,
sku
=
u'ABC123'
)),
]
}
path
=
reverse
(
'commerce
:
api:v1:courses:retrieve_update'
,
args
=
[
course_id
])
path
=
reverse
(
'commerce
_
api:v1:courses:retrieve_update'
,
args
=
[
course_id
])
response
=
self
.
client
.
put
(
path
,
json
.
dumps
(
expected
),
content_type
=
JSON_CONTENT_TYPE
)
self
.
assertEqual
(
response
.
status_code
,
200
)
actual
=
json
.
loads
(
response
.
content
)
...
...
@@ -156,7 +156,7 @@ class CourseRetrieveUpdateViewTests(CourseApiViewTestMixin, ModuleStoreTestCase)
CourseMode
(
mode_slug
=
u'honor'
,
min_price
=
0
,
currency
=
u'USD'
,
sku
=
u'DEADBEEF'
)),
]
}
path
=
reverse
(
'commerce
:
api:v1:courses:retrieve_update'
,
args
=
[
course_id
])
path
=
reverse
(
'commerce
_
api:v1:courses:retrieve_update'
,
args
=
[
course_id
])
response
=
self
.
client
.
put
(
path
,
json
.
dumps
(
expected
),
content_type
=
JSON_CONTENT_TYPE
,
**
request_kwargs
)
self
.
assertEqual
(
response
.
status_code
,
201
)
actual
=
json
.
loads
(
response
.
content
)
...
...
lms/djangoapps/commerce/urls.py
View file @
f9ce8264
...
...
@@ -13,5 +13,4 @@ urlpatterns = patterns(
url
(
r'^baskets/{}/order/$'
.
format
(
BASKET_ID_PATTERN
),
views
.
BasketOrderView
.
as_view
(),
name
=
"basket_order"
),
url
(
r'^checkout/cancel/$'
,
views
.
checkout_cancel
,
name
=
"checkout_cancel"
),
url
(
r'^checkout/receipt/$'
,
views
.
checkout_receipt
,
name
=
"checkout_receipt"
),
url
(
r'^api/'
,
include
(
'commerce.api.urls'
,
namespace
=
'api'
))
)
lms/urls.py
View file @
f9ce8264
...
...
@@ -89,6 +89,8 @@ urlpatterns = (
# Video Abstraction Layer used to allow video teams to manage video assets
# independently of courseware. https://github.com/edx/edx-val
url
(
r'^api/val/v0/'
,
include
(
'edxval.urls'
)),
url
(
r'^api/commerce/'
,
include
(
'commerce.api.urls'
,
namespace
=
'commerce_api'
)),
)
# Full Course/Library Import/Export API
...
...
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