remove discount banner from track selection

This commit is contained in:
Matthew Piatetsky
2019-11-08 11:29:59 -05:00
parent c5f03adb0e
commit b0c9662b51
7 changed files with 49 additions and 67 deletions

View File

@@ -398,40 +398,6 @@ class CourseModeViewTest(CatalogIntegrationMixin, UrlResetMixin, ModuleStoreTest
self.assertEquals(course_mode, expected_mode)
@patch('openedx.features.discounts.utils.can_receive_discount')
@patch('openedx.features.discounts.utils.discount_percentage')
def test_discount_on_track_selection(self, discount_percentage_mock, can_receive_discount_mock):
can_receive_discount_mock.return_value = True
discount_percentage_mock.return_value = 15
parameters = {
'mode_slug': 'verified',
'mode_display_name': 'Verified Certificate',
'min_price': 10
}
url = reverse('create_mode', args=[six.text_type(self.course.id)])
response = self.client.get(url, parameters)
CourseEnrollmentFactory(
is_active=True,
course_id=self.course.id,
user=self.user
)
response = self.client.get(
reverse('course_modes_choose', args=[six.text_type(self.course.id)]),
follow=False,
)
banner = u'''<div class="first-purchase-offer-banner" role="note">'''
button = u'''<button type="submit" name="verified_mode">
<span>Pursue a Verified Certificate</span>
(<span class="upgrade-price-string">$8.50 USD</span>
<del> <span class="upgrade-price-string">$10 USD</span></del>)
</button>'''
self.assertContains(response, banner)
self.assertContains(response, button, html=True)
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
def test_multiple_mode_creation(self):
# Create an honor mode

View File

@@ -211,15 +211,6 @@ class ChooseModeView(View):
context["verified_name"] = verified_mode.name
context["verified_description"] = verified_mode.description
offer_banner_fragment = get_first_purchase_offer_banner_fragment(
request.user, course
)
if offer_banner_fragment:
context['offer_banner_fragment'] = offer_banner_fragment
discounted_price = "{:0.2f}".format(price_before_discount * ((100.0 - discount_percentage(course)) / 100))
context["min_price"] = discounted_price
context["price_before_discount"] = price_before_discount
if verified_mode.sku:
context["use_ecommerce_payment_flow"] = ecommerce_service.is_enabled(request.user)
context["ecommerce_payment_page"] = ecommerce_service.payment_page_url()