removed entrance exam dependency on ENABLE_MKTG_SITE
changes after feedback from Matt D set default value of entrance_exams feature flags to false
This commit is contained in:
@@ -133,7 +133,11 @@ class CourseDetailsTestCase(CourseTestCase):
|
||||
def test_marketing_site_fetch(self):
|
||||
settings_details_url = get_url(self.course.id)
|
||||
|
||||
with mock.patch.dict('django.conf.settings.FEATURES', {'ENABLE_MKTG_SITE': True}):
|
||||
with mock.patch.dict('django.conf.settings.FEATURES', {
|
||||
'ENABLE_MKTG_SITE': True,
|
||||
'ENTRANCE_EXAMS': False,
|
||||
'ENABLE_PREREQUISITE_COURSES': False
|
||||
}):
|
||||
response = self.client.get_html(settings_details_url)
|
||||
self.assertNotContains(response, "Course Summary Page")
|
||||
self.assertNotContains(response, "Send a note to students via email")
|
||||
@@ -280,6 +284,7 @@ class CourseDetailsTestCase(CourseTestCase):
|
||||
self.assertContains(response, "Requirements")
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
class CourseDetailsViewTest(CourseTestCase):
|
||||
"""
|
||||
Tests for modifying content on the first course settings page (course dates, overview, etc.).
|
||||
@@ -410,6 +415,28 @@ class CourseDetailsViewTest(CourseTestCase):
|
||||
response = self.client.ajax_post(url, course_detail_json)
|
||||
self.assertEqual(400, response.status_code)
|
||||
|
||||
@ddt.data(
|
||||
(False, False, False),
|
||||
(True, False, True),
|
||||
(False, True, False),
|
||||
(True, True, True),
|
||||
)
|
||||
def test_visibility_of_entrance_exam_section(self, feature_flags):
|
||||
"""
|
||||
Tests entrance exam section is available if ENTRANCE_EXAMS feature is enabled no matter any other
|
||||
feature is enabled or disabled i.e ENABLE_MKTG_SITE.
|
||||
"""
|
||||
with patch.dict("django.conf.settings.FEATURES", {
|
||||
'ENTRANCE_EXAMS': feature_flags[0],
|
||||
'ENABLE_MKTG_SITE': feature_flags[1]
|
||||
}):
|
||||
course_details_url = get_url(self.course.id)
|
||||
resp = self.client.get_html(course_details_url)
|
||||
self.assertEqual(
|
||||
feature_flags[2],
|
||||
'<h3 id="heading-entrance-exam">' in resp.content
|
||||
)
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
class CourseGradingTest(CourseTestCase):
|
||||
|
||||
@@ -67,7 +67,8 @@ from contentstore.tasks import rerun_course
|
||||
from contentstore.views.entrance_exam import (
|
||||
create_entrance_exam,
|
||||
update_entrance_exam,
|
||||
delete_entrance_exam
|
||||
delete_entrance_exam,
|
||||
is_entrance_exams_enabled
|
||||
)
|
||||
|
||||
from .library import LIBRARIES_ENABLED
|
||||
@@ -927,7 +928,8 @@ def settings_handler(request, course_key_string):
|
||||
'is_credit_course': False,
|
||||
'show_min_grade_warning': False,
|
||||
'enrollment_end_editable': enrollment_end_editable,
|
||||
'is_prerequisite_courses_enabled': is_prerequisite_courses_enabled()
|
||||
'is_prerequisite_courses_enabled': is_prerequisite_courses_enabled(),
|
||||
'is_entrance_exams_enabled': is_entrance_exams_enabled()
|
||||
}
|
||||
if is_prerequisite_courses_enabled():
|
||||
courses, in_process_course_actions = get_courses_accessible_to_user(request)
|
||||
|
||||
@@ -54,6 +54,13 @@ def check_feature_enabled(feature_name):
|
||||
return _check_feature_enabled
|
||||
|
||||
|
||||
def is_entrance_exams_enabled():
|
||||
"""
|
||||
Returns a boolean indicating entrance exam feature is enable or not.
|
||||
"""
|
||||
return settings.FEATURES.get('ENTRANCE_EXAMS', False)
|
||||
|
||||
|
||||
@login_required
|
||||
@ensure_csrf_cookie
|
||||
@check_feature_enabled(feature_name='ENTRANCE_EXAMS')
|
||||
|
||||
@@ -361,7 +361,7 @@ CMS.URL.UPLOAD_ASSET = '${upload_asset_url}';
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
% if about_page_editable:
|
||||
% if about_page_editable or is_prerequisite_courses_enabled or is_entrance_exams_enabled:
|
||||
<hr class="divide" />
|
||||
|
||||
<section class="group-settings requirements">
|
||||
@@ -371,11 +371,13 @@ CMS.URL.UPLOAD_ASSET = '${upload_asset_url}';
|
||||
</header>
|
||||
|
||||
<ol class="list-input">
|
||||
% if about_page_editable:
|
||||
<li class="field text" id="field-course-effort">
|
||||
<label for="course-effort">${_("Hours of Effort per Week")}</label>
|
||||
<input type="text" class="short time" id="course-effort" placeholder="HH:MM" />
|
||||
<span class="tip tip-inline">${_("Time spent on all course work")}</span>
|
||||
</li>
|
||||
% endif
|
||||
% if is_prerequisite_courses_enabled:
|
||||
<li class="field field-select" id="field-pre-requisite-course">
|
||||
<label for="pre-requisite-course">${_("Prerequisite Course")}</label>
|
||||
@@ -389,7 +391,7 @@ CMS.URL.UPLOAD_ASSET = '${upload_asset_url}';
|
||||
<button type="submit" class="sr" name="submit" value="submit">${_("set pre-requisite course")}</button>
|
||||
</li>
|
||||
% endif
|
||||
% if settings.FEATURES.get('ENTRANCE_EXAMS'):
|
||||
% if is_entrance_exams_enabled:
|
||||
<li>
|
||||
<h3 id="heading-entrance-exam">${_("Entrance Exam")}</h3>
|
||||
<div class="show-data">
|
||||
|
||||
Reference in New Issue
Block a user