Merge pull request #14943 from edx/iivic/LEARNER-605

Enable all products to be displayed on receipt page
This commit is contained in:
Ivan Ivic
2017-04-24 17:00:52 +02:00
committed by GitHub
3 changed files with 6 additions and 29 deletions

View File

@@ -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

View File

@@ -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):

View File

@@ -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