remove discount banner display flag
This commit is contained in:
@@ -24,7 +24,6 @@ from openedx.core.djangoapps.catalog.tests.mixins import CatalogIntegrationMixin
|
||||
from openedx.core.djangoapps.embargo.test_utils import restrict_course
|
||||
from openedx.core.djangoapps.theming.tests.test_util import with_comprehensive_theme
|
||||
from openedx.core.djangoapps.waffle_utils.testutils import override_waffle_flag
|
||||
from openedx.features.course_experience import FIRST_PURCHASE_OFFER_BANNER_DISPLAY
|
||||
from student.models import CourseEnrollment
|
||||
from student.tests.factories import CourseEnrollmentFactory, UserFactory
|
||||
from util.testing import UrlResetMixin
|
||||
@@ -401,7 +400,6 @@ class CourseModeViewTest(CatalogIntegrationMixin, UrlResetMixin, ModuleStoreTest
|
||||
|
||||
@patch('openedx.features.course_experience.utils.can_receive_discount')
|
||||
@patch('openedx.features.course_experience.utils.discount_percentage')
|
||||
@override_waffle_flag(FIRST_PURCHASE_OFFER_BANNER_DISPLAY, active=True)
|
||||
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
|
||||
|
||||
@@ -48,10 +48,6 @@ USE_BOOTSTRAP_FLAG = CourseWaffleFlag(WAFFLE_FLAG_NAMESPACE, 'use_bootstrap', fl
|
||||
SEO_WAFFLE_FLAG_NAMESPACE = WaffleFlagNamespace(name='seo')
|
||||
COURSE_ENABLE_UNENROLLED_ACCESS_FLAG = CourseWaffleFlag(SEO_WAFFLE_FLAG_NAMESPACE, 'enable_anonymous_courseware_access')
|
||||
|
||||
# Flag to control display of first purchase offer banner
|
||||
FIRST_PURCHASE_OFFER_BANNER = WaffleFlagNamespace(name='first_purchase_offer_banner')
|
||||
FIRST_PURCHASE_OFFER_BANNER_DISPLAY = WaffleFlag(FIRST_PURCHASE_OFFER_BANNER, 'display', flag_undefined_default=False)
|
||||
|
||||
|
||||
def course_home_page_title(course): # pylint: disable=unused-argument
|
||||
"""
|
||||
|
||||
@@ -49,7 +49,6 @@ from openedx.features.course_duration_limits.config import EXPERIMENT_DATA_HOLDB
|
||||
from openedx.features.course_duration_limits.models import CourseDurationLimitConfig
|
||||
from openedx.features.course_experience import (
|
||||
COURSE_ENABLE_UNENROLLED_ACCESS_FLAG,
|
||||
FIRST_PURCHASE_OFFER_BANNER_DISPLAY,
|
||||
SHOW_REVIEWS_TOOL_FLAG,
|
||||
SHOW_UPGRADE_MSG_ON_COURSE_HOME,
|
||||
UNIFIED_COURSE_TAB_FLAG
|
||||
@@ -411,7 +410,6 @@ class TestCourseHomePageAccess(CourseHomePageTestCase):
|
||||
)
|
||||
self.assertRedirects(response, expected_url)
|
||||
|
||||
@override_waffle_flag(FIRST_PURCHASE_OFFER_BANNER_DISPLAY, active=True)
|
||||
@mock.patch('openedx.features.course_experience.utils.discount_percentage')
|
||||
@mock.patch('openedx.features.course_experience.utils.can_receive_discount')
|
||||
@ddt.data(
|
||||
|
||||
@@ -13,7 +13,6 @@ from lms.djangoapps.course_api.blocks.api import get_blocks
|
||||
from lms.djangoapps.course_blocks.utils import get_student_module_as_dict
|
||||
from openedx.core.djangolib.markup import HTML
|
||||
from openedx.core.lib.cache_utils import request_cached
|
||||
from openedx.features.course_experience import FIRST_PURCHASE_OFFER_BANNER_DISPLAY
|
||||
from openedx.features.discounts.applicability import can_receive_discount, discount_percentage
|
||||
from xmodule.modulestore.django import modulestore
|
||||
|
||||
@@ -193,10 +192,7 @@ def get_resume_block(block):
|
||||
|
||||
|
||||
def get_first_purchase_offer_banner_fragment(user, course):
|
||||
if (FIRST_PURCHASE_OFFER_BANNER_DISPLAY.is_enabled() and
|
||||
user and
|
||||
course and
|
||||
can_receive_discount(user=user, course=course)):
|
||||
if user and course and can_receive_discount(user=user, course=course):
|
||||
# Translator: xgettext:no-python-format
|
||||
offer_message = _(u'{banner_open}{percentage}% off your first upgrade.{span_close}'
|
||||
u' Discount automatically applied.{div_close}')
|
||||
@@ -208,3 +204,4 @@ def get_first_purchase_offer_banner_fragment(user, course):
|
||||
span_close=HTML('</span>'),
|
||||
div_close=HTML('</div>')
|
||||
))
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user