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
41cfbcfb
Commit
41cfbcfb
authored
Apr 24, 2017
by
Ivan Ivic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable all products to be displayed on receipt page
LEARNER-605
parent
70e13407
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
29 deletions
+6
-29
lms/djangoapps/commerce/tests/mocks.py
+6
-1
lms/djangoapps/student_account/test/test_views.py
+0
-18
lms/djangoapps/student_account/views.py
+0
-10
No files found.
lms/djangoapps/commerce/tests/mocks.py
View file @
41cfbcfb
...
...
@@ -180,7 +180,12 @@ class mock_get_orders(mock_ecommerce_api_endpoint):
)])
),
]
)
),
factories
.
OrderFactory
(
lines
=
[
factories
.
OrderLineFactory
(
product
=
factories
.
ProductFactory
(
product_class
=
'Coupon'
))
]
),
]
}
method
=
httpretty
.
GET
...
...
lms/djangoapps/student_account/test/test_views.py
View file @
41cfbcfb
...
...
@@ -697,24 +697,6 @@ class AccountSettingsViewTest(ThirdPartyAuthTestMixin, TestCase, ProgramsApiConf
self
.
assertEqual
(
len
(
order_detail
),
1
)
def
test_order_history_with_coupon
(
self
):
"""
Verify that get_order_details returns empty receipt_url for coupon product.
"""
response
=
{
'results'
:
[
factories
.
OrderFactory
(
lines
=
[
factories
.
OrderLineFactory
(
product
=
factories
.
ProductFactory
(
product_class
=
'Coupon'
))
]
)
]
}
with
mock_get_orders
(
response
=
response
):
order_detail
=
get_user_orders
(
self
.
user
)
self
.
assertEqual
(
order_detail
[
0
][
'receipt_url'
],
''
)
@override_settings
(
SITE_NAME
=
settings
.
MICROSITE_LOGISTRATION_HOSTNAME
)
class
MicrositeLogistrationTests
(
TestCase
):
...
...
lms/djangoapps/student_account/views.py
View file @
41cfbcfb
...
...
@@ -351,16 +351,6 @@ def get_user_orders(user):
'receipt_url'
:
EcommerceService
()
.
get_receipt_page_url
(
order
[
'number'
]),
'lines'
:
order
[
'lines'
],
}
# If the order lines contain a product that is not a Seat
# we do not want to display the Order Details button. It
# will break the receipt page if used.
for
order_line
in
order
[
'lines'
]:
product
=
order_line
.
get
(
'product'
)
if
product
and
product
.
get
(
'product_class'
)
!=
'Seat'
:
order_data
[
'receipt_url'
]
=
''
break
user_orders
.
append
(
order_data
)
return
user_orders
...
...
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