Merge pull request #14943 from edx/iivic/LEARNER-605
Enable all products to be displayed on receipt page
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user