Hide edx-when feature behind waffle flag

This commit is contained in:
Dave St.Germain
2019-04-24 15:38:22 -04:00
parent b4ccd03740
commit 42ede57383
7 changed files with 10 additions and 8 deletions

View File

@@ -213,8 +213,8 @@ class IndexQueryTestCase(ModuleStoreTestCase):
NUM_PROBLEMS = 20
@ddt.data(
(ModuleStoreEnum.Type.mongo, 10, 178),
(ModuleStoreEnum.Type.split, 4, 172),
(ModuleStoreEnum.Type.mongo, 10, 176),
(ModuleStoreEnum.Type.split, 4, 170),
)
@ddt.unpack
def test_index_query_counts(self, store_type, expected_mongo_query_count, expected_mysql_query_count):

View File

@@ -15,7 +15,7 @@ from django.test import TestCase
from opaque_keys.edx.keys import CourseKey
from pytz import UTC
from edx_when import signals
from edx_when import signals, api
from edx_when.field_data import DateLookupFieldData
from student.tests.factories import UserFactory
from xmodule.fields import Date
@@ -240,6 +240,7 @@ class TestSetDueDateExtension(ModuleStoreTestCase):
block._field_data._load_dates(self.course.id, self.user, use_cached=False) # pylint: disable=protected-access
block.fields['due']._del_cached_value(block) # pylint: disable=protected-access
@api.override_enabled()
def test_set_due_date_extension(self):
extended = datetime.datetime(2013, 12, 25, 0, 0, tzinfo=UTC)
tools.set_due_date_extension(self.course, self.week1, self.user, extended)

View File

@@ -33,6 +33,7 @@ from courseware.courses import get_course_by_id, get_studio_url
from django_comment_client.utils import available_division_schemes, has_forum_access
from django_comment_common.models import FORUM_ROLE_ADMINISTRATOR, CourseDiscussionSettings
from edxmako.shortcuts import render_to_response
from edx_when.api import is_enabled_for_course
from lms.djangoapps.certificates import api as certs_api
from lms.djangoapps.certificates.models import (
CertificateGenerationConfiguration,
@@ -159,7 +160,7 @@ def instructor_dashboard_2(request, course_id):
unicode(course_key), len(paid_modes)
)
if access['instructor']:
if access['instructor'] and is_enabled_for_course(course_key, request=request):
sections.insert(3, _section_extensions(course))
# Gate access to course email by feature flag & by course-specific authorization

View File

@@ -130,7 +130,7 @@ class TestCourseUpdatesPage(SharedModuleStoreTestCase):
# Fetch the view and verify that the query counts haven't changed
# TODO: decrease query count as part of REVO-28
with self.assertNumQueries(52, table_blacklist=QUERY_COUNT_TABLE_BLACKLIST):
with self.assertNumQueries(50, table_blacklist=QUERY_COUNT_TABLE_BLACKLIST):
with check_mongo_calls(4):
url = course_updates_url(self.course)
self.client.get(url)

View File

@@ -125,7 +125,7 @@ edx-rest-api-client==1.9.2
edx-search==1.2.2
edx-submissions==2.1.1
edx-user-state-client==1.0.4
edx-when==0.1.1
edx-when==0.1.2
edxval==1.1.25
elasticsearch==1.9.0 # via edx-search
enum34==1.1.6

View File

@@ -148,7 +148,7 @@ edx-search==1.2.2
edx-sphinx-theme==1.4.0
edx-submissions==2.1.1
edx-user-state-client==1.0.4
edx-when==0.1.1
edx-when==0.1.2
edxval==1.1.25
elasticsearch==1.9.0
entrypoints==0.3

View File

@@ -143,7 +143,7 @@ edx-rest-api-client==1.9.2
edx-search==1.2.2
edx-submissions==2.1.1
edx-user-state-client==1.0.4
edx-when==0.1.1
edx-when==0.1.2
edxval==1.1.25
elasticsearch==1.9.0
entrypoints==0.3 # via flake8