Merge pull request #16583 from edx/bfiller/ENT-727
Disable View Consent button on dashboard
This commit is contained in:
@@ -336,43 +336,3 @@ class StudentDashboardTests(SharedModuleStoreTestCase, MilestonesTestCaseMixin):
|
||||
remove_prerequisite_course(self.course.id, get_course_milestones(self.course.id)[0])
|
||||
response = self.client.get(reverse('dashboard'))
|
||||
self.assertNotIn('<div class="prerequisites">', response.content)
|
||||
|
||||
@mock.patch('student.views.consent_needed_for_course')
|
||||
@mock.patch('student.views.enterprise_customer_for_request')
|
||||
@ddt.data(
|
||||
(True, True, True),
|
||||
(True, True, False),
|
||||
(True, False, False),
|
||||
(False, True, False),
|
||||
(False, False, False),
|
||||
)
|
||||
@ddt.unpack
|
||||
def test_enterprise_view_consent_for_course(
|
||||
self,
|
||||
enterprise_enabled,
|
||||
consent_needed,
|
||||
future_course,
|
||||
mock_enterprise_customer,
|
||||
mock_consent_necessary
|
||||
):
|
||||
"""
|
||||
Verify that the 'View Consent' icon show up if data sharing consent turned on
|
||||
for enterprise customer
|
||||
"""
|
||||
if future_course:
|
||||
self.course = CourseFactory.create(start=self.TOMORROW, emit_signals=True)
|
||||
else:
|
||||
self.course = CourseFactory.create(emit_signals=True)
|
||||
self.course_enrollment = CourseEnrollmentFactory(course_id=self.course.id, user=self.user)
|
||||
|
||||
if enterprise_enabled:
|
||||
mock_enterprise_customer.return_value = {'name': 'TestEnterprise', 'uuid': 'abc123xxx'}
|
||||
else:
|
||||
mock_enterprise_customer.return_value = None
|
||||
|
||||
mock_consent_necessary.return_value = consent_needed
|
||||
|
||||
# Assert 'View Consent' button shows up appropriately
|
||||
response = self.client.get(reverse('dashboard'))
|
||||
self.assertEquals('View Consent' in response.content, enterprise_enabled and consent_needed)
|
||||
self.assertEquals('TestEnterprise' in response.content, enterprise_enabled and consent_needed)
|
||||
|
||||
@@ -87,11 +87,7 @@ from openedx.core.djangoapps.theming import helpers as theming_helpers
|
||||
from openedx.core.djangoapps.user_api.preferences import api as preferences_api
|
||||
from openedx.core.djangolib.markup import HTML
|
||||
from openedx.features.course_experience import course_home_url_name
|
||||
from openedx.features.enterprise_support.api import (
|
||||
consent_needed_for_course,
|
||||
enterprise_customer_for_request,
|
||||
get_dashboard_consent_notification
|
||||
)
|
||||
from openedx.features.enterprise_support.api import get_dashboard_consent_notification
|
||||
from shoppingcart.api import order_history
|
||||
from shoppingcart.models import CourseRegistrationCode, DonationConfiguration
|
||||
from student.cookies import delete_logged_in_cookies, set_logged_in_cookies, set_user_info_cookie
|
||||
@@ -738,15 +734,10 @@ def dashboard(request):
|
||||
|
||||
enterprise_message = get_dashboard_consent_notification(request, user, course_enrollments)
|
||||
|
||||
enterprise_customer = enterprise_customer_for_request(request)
|
||||
# Disable lookup of Enterprise consent_required_course due to ENT-727
|
||||
# Will re-enable after fixing WL-1315
|
||||
consent_required_courses = set()
|
||||
enterprise_customer_name = None
|
||||
if enterprise_customer:
|
||||
consent_required_courses = {
|
||||
enrollment.course_id for enrollment in course_enrollments
|
||||
if consent_needed_for_course(request, request.user, str(enrollment.course_id), True)
|
||||
}
|
||||
enterprise_customer_name = enterprise_customer['name']
|
||||
|
||||
# Account activation message
|
||||
account_activation_messages = [
|
||||
|
||||
Reference in New Issue
Block a user