From 66bbe9023bb9e84ada9ffb9317fdbc05131ef1b9 Mon Sep 17 00:00:00 2001 From: Nimisha Asthagiri Date: Mon, 10 Jul 2017 20:55:00 -0400 Subject: [PATCH] RET: Cleanup Planning Prompts experimental code --- lms/djangoapps/courseware/views/views.py | 22 ------------------- lms/templates/courseware/experiments.html | 6 ----- .../tests/views/test_course_home.py | 2 +- .../tests/views/test_course_updates.py | 2 +- 4 files changed, 2 insertions(+), 30 deletions(-) diff --git a/lms/djangoapps/courseware/views/views.py b/lms/djangoapps/courseware/views/views.py index fd8f49fd70..995ace67d8 100644 --- a/lms/djangoapps/courseware/views/views.py +++ b/lms/djangoapps/courseware/views/views.py @@ -511,9 +511,6 @@ class CourseTabView(EdxFragmentView): 'upgrade_link': check_and_get_upgrade_link(request, request.user, course.id), 'upgrade_price': get_cosmetic_verified_display_price(course), # ENDTODO - # TODO: (Experimental Code). See https://openedx.atlassian.net/wiki/display/RET/3.+Planning+Prompts - 'display_planning_prompt': _should_display_planning_prompt(request, course), - # ENDTODO } def render_to_fragment(self, request, course=None, page_context=None, **kwargs): @@ -533,25 +530,6 @@ class CourseTabView(EdxFragmentView): return render_to_response('courseware/tab-view.html', page_context) -# TODO: (Experimental Code). See https://openedx.atlassian.net/wiki/display/RET/3.+Planning+Prompts -def _should_display_planning_prompt(request, course): - """ - A planning prompt is enabled in the experiment for all enrollments whose - content availability date is less than 14 days from today. - - The content availability date is defined as either the course start date - or the enrollment date, whichever was most recent. - """ - is_course_in_english = not course.language or course.language.lower() == u'en' - if is_course_in_english: - enrollment = CourseEnrollment.get_enrollment(request.user, course.id) - if enrollment and enrollment.is_active: - content_availability_date = max(course.start, enrollment.created) - return content_availability_date > (datetime.now(utc) - timedelta(days=14)) - return False -# ENDTODO - - @ensure_csrf_cookie @ensure_valid_course_key def syllabus(request, course_id): diff --git a/lms/templates/courseware/experiments.html b/lms/templates/courseware/experiments.html index 49065f0e96..08a2c93bad 100644 --- a/lms/templates/courseware/experiments.html +++ b/lms/templates/courseware/experiments.html @@ -9,9 +9,3 @@ % endif ## ENDTODO - -## TODO: (Experimental Code). See https://openedx.atlassian.net/wiki/display/RET/3.+Planning+Prompts -% if display_planning_prompt: - -% endif -## ENDTODO diff --git a/openedx/features/course_experience/tests/views/test_course_home.py b/openedx/features/course_experience/tests/views/test_course_home.py index 07a840902f..3413e5179e 100644 --- a/openedx/features/course_experience/tests/views/test_course_home.py +++ b/openedx/features/course_experience/tests/views/test_course_home.py @@ -120,7 +120,7 @@ class TestCourseHomePage(CourseHomePageTestCase): course_home_url(self.course) # Fetch the view and verify the query counts - with self.assertNumQueries(39, table_blacklist=QUERY_COUNT_TABLE_BLACKLIST): + with self.assertNumQueries(38, table_blacklist=QUERY_COUNT_TABLE_BLACKLIST): with check_mongo_calls(4): url = course_home_url(self.course) self.client.get(url) diff --git a/openedx/features/course_experience/tests/views/test_course_updates.py b/openedx/features/course_experience/tests/views/test_course_updates.py index aa7f3f1ec8..ad2d481381 100644 --- a/openedx/features/course_experience/tests/views/test_course_updates.py +++ b/openedx/features/course_experience/tests/views/test_course_updates.py @@ -127,7 +127,7 @@ class TestCourseUpdatesPage(SharedModuleStoreTestCase): course_updates_url(self.course) # Fetch the view and verify that the query counts haven't changed - with self.assertNumQueries(32, table_blacklist=QUERY_COUNT_TABLE_BLACKLIST): + with self.assertNumQueries(31, table_blacklist=QUERY_COUNT_TABLE_BLACKLIST): with check_mongo_calls(4): url = course_updates_url(self.course) self.client.get(url)