Merge pull request #20706 from edx/depr/microsites-shopping-cart
Remove microsites from shoppingcart
This commit is contained in:
@@ -23,9 +23,6 @@ def order_history(user, **kwargs):
|
||||
for order_item in purchased_order_items:
|
||||
# Avoid repeated entries for the same order id.
|
||||
if order_item.order.id not in [item['order_id'] for item in order_history_list]:
|
||||
# If we are in a Microsite, then include the orders having courses attributed (by ORG) to that Microsite.
|
||||
# Conversely, if we are not in a Microsite, then include the orders having courses
|
||||
# not attributed (by ORG) to any Microsite.
|
||||
order_item_course_id = getattr(order_item, 'course_id', None)
|
||||
if order_item_course_id:
|
||||
if (course_org_filter and order_item_course_id.org in course_org_filter) or \
|
||||
|
||||
@@ -23,12 +23,4 @@ def get_processor_config():
|
||||
config = settings.CC_PROCESSOR.get(
|
||||
settings.CC_PROCESSOR_NAME, {}
|
||||
)
|
||||
|
||||
# Check whether configuration override exists,
|
||||
# If so, find the configuration-specific cybersource config in the configurations.
|
||||
# sub-key of the normal processor configuration.
|
||||
config_key = configuration_helpers.get_value('cybersource_config_key')
|
||||
if config_key:
|
||||
config = config['microsites'][config_key]
|
||||
|
||||
return config
|
||||
|
||||
@@ -1449,9 +1449,9 @@ class ShoppingCartViewsTests(SharedModuleStoreTestCase, XssTestMixin):
|
||||
}
|
||||
)
|
||||
|
||||
def test_shopping_cart_navigation_link_not_in_microsite(self):
|
||||
def test_shopping_cart_navigation_link(self):
|
||||
"""
|
||||
Tests shopping cart link is available in navigation header if request is not from a microsite.
|
||||
Tests shopping cart link is available in navigation header.
|
||||
"""
|
||||
CourseEnrollment.enroll(self.user, self.course_key)
|
||||
self.add_course_to_user_cart(self.testing_course.id)
|
||||
@@ -1459,9 +1459,9 @@ class ShoppingCartViewsTests(SharedModuleStoreTestCase, XssTestMixin):
|
||||
self.assertEqual(resp.status_code, 200)
|
||||
self.assertIn('<a class="shopping-cart"', resp.content)
|
||||
|
||||
def test_shopping_cart_navigation_link_not_in_microsite_and_not_on_courseware(self):
|
||||
def test_shopping_cart_navigation_link_and_not_on_courseware(self):
|
||||
"""
|
||||
Tests shopping cart link is available in navigation header if request is not from a microsite
|
||||
Tests shopping cart link is available in navigation header
|
||||
and requested page is not courseware too.
|
||||
"""
|
||||
CourseEnrollment.enroll(self.user, self.course_key)
|
||||
@@ -1470,32 +1470,6 @@ class ShoppingCartViewsTests(SharedModuleStoreTestCase, XssTestMixin):
|
||||
self.assertEqual(resp.status_code, 200)
|
||||
self.assertIn('<a class="shopping-cart"', resp.content)
|
||||
|
||||
def test_shopping_cart_navigation_link_in_microsite_not_on_courseware(self):
|
||||
"""
|
||||
Tests shopping cart link is available in navigation header if request is from a microsite but requested
|
||||
page is not from courseware.
|
||||
"""
|
||||
CourseEnrollment.enroll(self.user, self.course_key)
|
||||
self.add_course_to_user_cart(self.testing_course.id)
|
||||
with patch('microsite_configuration.microsite.is_request_in_microsite',
|
||||
Mock(return_value=True)):
|
||||
resp = self.client.get(reverse('dashboard'))
|
||||
self.assertEqual(resp.status_code, 200)
|
||||
self.assertIn('<a class="shopping-cart"', resp.content)
|
||||
|
||||
def test_shopping_cart_navigation_link_in_microsite_courseware_page(self):
|
||||
"""
|
||||
Tests shopping cart link is not available in navigation header if request is from a microsite
|
||||
and requested page is from courseware.
|
||||
"""
|
||||
CourseEnrollment.enroll(self.user, self.course_key)
|
||||
self.add_course_to_user_cart(self.testing_course.id)
|
||||
with patch('microsite_configuration.microsite.is_request_in_microsite',
|
||||
Mock(return_value=True)):
|
||||
resp = self.client.get(reverse('courseware', kwargs={'course_id': text_type(self.course.id)}))
|
||||
self.assertEqual(resp.status_code, 200)
|
||||
self.assertNotIn('<a class="shopping-cart"', resp.content)
|
||||
|
||||
|
||||
class ReceiptRedirectTest(SharedModuleStoreTestCase):
|
||||
"""Test special-case redirect from the receipt page. """
|
||||
|
||||
Reference in New Issue
Block a user