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
5b25940c
Commit
5b25940c
authored
Aug 21, 2013
by
Jason Bau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shopping cart view tests. coverage full except for debug line
parent
a5ee2add
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
2 deletions
+7
-2
lms/djangoapps/shoppingcart/models.py
+4
-1
lms/djangoapps/shoppingcart/tests/test_views.py
+0
-0
lms/djangoapps/shoppingcart/views.py
+1
-1
lms/envs/test.py
+2
-0
No files found.
lms/djangoapps/shoppingcart/models.py
View file @
5b25940c
...
...
@@ -67,7 +67,10 @@ class Order(models.Model):
@property
def
total_cost
(
self
):
""" Return the total cost of the order """
"""
Return the total cost of the cart. If the order has been purchased, returns total of
all purchased and not refunded items.
"""
return
sum
(
i
.
line_cost
for
i
in
self
.
orderitem_set
.
filter
(
status
=
self
.
status
))
def
clear
(
self
):
...
...
lms/djangoapps/shoppingcart/tests/test_views.py
View file @
5b25940c
This diff is collapsed.
Click to expand it.
lms/djangoapps/shoppingcart/views.py
View file @
5b25940c
...
...
@@ -26,7 +26,7 @@ def add_course_to_cart(request, course_id):
PaidCourseRegistration
.
add_to_order
(
cart
,
course_id
)
except
ItemNotFoundError
:
return
HttpResponseNotFound
(
_
(
'The course you requested does not exist.'
))
if
request
.
method
==
'GET'
:
if
request
.
method
==
'GET'
:
### This is temporary for testing purposes and will go away before we pull
return
HttpResponseRedirect
(
reverse
(
'shoppingcart.views.show_cart'
))
return
HttpResponse
(
_
(
"Course added to cart."
))
...
...
lms/envs/test.py
View file @
5b25940c
...
...
@@ -32,6 +32,8 @@ MITX_FEATURES['ENABLE_HINTER_INSTRUCTOR_VIEW'] = True
MITX_FEATURES
[
'ENABLE_INSTRUCTOR_BETA_DASHBOARD'
]
=
True
MITX_FEATURES
[
'ENABLE_SHOPPING_CART'
]
=
True
# Need wiki for courseware views to work. TODO (vshnayder): shouldn't need it.
WIKI_ENABLED
=
True
...
...
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