Commit c8706044 by Diana Huang Committed by GitHub

Merge pull request #16090 from edx/diana/remove-waffle-flag

LEARNER-2443 Remove waffle flag for showing certs on profile.
parents a2dc27e6 b5a0d0ce
......@@ -8,10 +8,6 @@ from openedx.core.djangoapps.waffle_utils import WaffleFlag, WaffleFlagNamespace
# Namespace for learner profile waffle flags.
WAFFLE_FLAG_NAMESPACE = WaffleFlagNamespace(name='learner_profile')
# Waffle flag to show achievements on the learner profile.
# TODO: LEARNER-2443: 08/2017: Remove flag after rollout.
SHOW_ACHIEVEMENTS_FLAG = WaffleFlag(WAFFLE_FLAG_NAMESPACE, 'show_achievements')
# Waffle flag for showing a message about the new profile features.
# TODO: LEARNER-2554: 09/2017: Remove flag once message is no longer needed.
SHOW_PROFILE_MESSAGE = WaffleFlag(WAFFLE_FLAG_NAMESPACE, 'show_message')
......@@ -19,8 +19,6 @@ from util.testing import UrlResetMixin
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from ... import SHOW_ACHIEVEMENTS_FLAG
@ddt.ddt
class LearnerProfileViewTest(UrlResetMixin, ModuleStoreTestCase):
......@@ -133,7 +131,6 @@ class LearnerProfileViewTest(UrlResetMixin, ModuleStoreTestCase):
)
@ddt.data(CourseMode.HONOR, CourseMode.PROFESSIONAL, CourseMode.VERIFIED)
@override_waffle_flag(SHOW_ACHIEVEMENTS_FLAG, active=True)
def test_certificate_visibility(self, cert_mode):
"""
Verify that certificates are displayed with the correct card mode.
......@@ -151,7 +148,6 @@ class LearnerProfileViewTest(UrlResetMixin, ModuleStoreTestCase):
['notpassing', False],
)
@ddt.unpack
@override_waffle_flag(SHOW_ACHIEVEMENTS_FLAG, active=True)
def test_certificate_status_visibility(self, status, is_passed_status):
"""
Verify that certificates are only displayed for passing status.
......@@ -170,7 +166,6 @@ class LearnerProfileViewTest(UrlResetMixin, ModuleStoreTestCase):
else:
self.assertNotContains(response, 'card certificate-card mode-{cert_mode}'.format(cert_mode=cert.mode))
@override_waffle_flag(SHOW_ACHIEVEMENTS_FLAG, active=True)
def test_certificate_for_missing_course(self):
"""
Verify that a certificate is not shown for a missing course.
......@@ -184,7 +179,6 @@ class LearnerProfileViewTest(UrlResetMixin, ModuleStoreTestCase):
self.assertNotContains(response, 'card certificate-card mode-{cert_mode}'.format(cert_mode=cert.mode))
@ddt.data(True, False)
@override_waffle_flag(SHOW_ACHIEVEMENTS_FLAG, active=True)
def test_no_certificate_visibility(self, own_profile):
"""
Verify that the 'You haven't earned any certificates yet.' well appears on the user's
......@@ -200,7 +194,6 @@ class LearnerProfileViewTest(UrlResetMixin, ModuleStoreTestCase):
self.assertNotContains(response, 'You haven't earned any certificates yet.')
@ddt.data(True, False)
@override_waffle_flag(SHOW_ACHIEVEMENTS_FLAG, active=True)
def test_explore_courses_visibility(self, courses_browsable):
with mock.patch.dict('django.conf.settings.FEATURES', {'COURSES_ARE_BROWSABLE': courses_browsable}):
response = self.client.get('/u/{username}'.format(username=self.user.username))
......
......@@ -20,7 +20,7 @@ from openedx.core.djangoapps.util.user_messages import PageLevelMessages
from openedx.core.djangolib.markup import HTML, Text
from student.models import User
from .. import SHOW_ACHIEVEMENTS_FLAG, SHOW_PROFILE_MESSAGE
from .. import SHOW_PROFILE_MESSAGE
from learner_achievements import LearnerAchievementsFragmentView
......@@ -100,14 +100,11 @@ def learner_profile_context(request, profile_username, user_is_staff):
preferences_data = get_user_preferences(profile_user, profile_username)
if SHOW_ACHIEVEMENTS_FLAG.is_enabled():
achievements_fragment = LearnerAchievementsFragmentView().render_to_fragment(
request,
username=profile_user.username,
own_profile=own_profile,
)
else:
achievements_fragment = None
achievements_fragment = LearnerAchievementsFragmentView().render_to_fragment(
request,
username=profile_user.username,
own_profile=own_profile,
)
context = {
'own_profile': own_profile,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment