Fix n-click behaviour on poster. Fix unit tests. Fix handler for non_en lang for bumper. Add more tests. Fix docstrings. Fix pep8. Fix static redirection with bumper. Fix button in IE11. Add video_bumper field in bok_choy. Fix pylink violations. Update docstrings and some clean up. Rename edx_video_id in bumper tests. Fix too long lines in help text. Address ui comments. Fix bumper events. Refactor bumper-transcripts code, fix bugs, address comments. Squashed commits: Fix download transcript button. [74e0c8c] Fix quality [a759f33] Fix error, when sub contains extension. [b30755c] Revert "Add video files to host for transcripts." This reverts commit cf8a96bf84346e17b6ad57ad4cc6a27d7a9118cd. [36f038a] Add video files to host for transcripts. [23f1655] Fix pep8 and pyling issues. [0f1f9d2] Update acceptance test. [765a27d] Wait for ajax in captions. [8ae72a3] Fix logic. [063450f] Fix unit tests. [d1075fc] Fix handlers tests. [25d31ad] Update bumper_utils. [cb5f9df] Remove maxDiff. [8738b1a] Code cleanup. [87dbcb7] Fix issues with transcripts. [ec899de] Fix transcripts in serializers. [444b1fc] Fix transcripts typo. [d524cb5] Fix bumper. [f62cf22] Fix video mongo tests. [8f1b55a] Fix dispatches. [53bc308] Add more fixes. [d5e3723] Fix test_video_handlers and rename the method. [93efc23] Fix mobile tests. [740e2ae] Fix pep8 and pylint. [47cfb66] Address comments, add fixes. [4e499d9] Add fixes. [8353553] Add improvements. Updated dispatch values) . Use ddt in bumper handler tests. Move common metadata to single place. Fix style. Update docstring. Fix poster button. Improve bumper events. Fix test after rebase. Address comments. Download transcript: use def video lang, not bump. Renamed date_last_view_bumper to bumper_last_view_date. Rename do_not_show_again_bumper to bumper_... Address comments. Fix tests for download for en lang. Fix bumper logic. Update strings. Update resizer. Remove resizer. Fix unit tests. Add tests. Fix bumper events. Clean up tests. Fix pylint violations. Fix pep8 and pylint violations. Update docs and method names. Update events. Make /static/ prefix a must. Fix wrong code.
110 lines
3.8 KiB
Python
110 lines
3.8 KiB
Python
"""
|
|
Settings for bok choy tests
|
|
"""
|
|
|
|
import os
|
|
from path import path
|
|
|
|
# Pylint gets confused by path.py instances, which report themselves as class
|
|
# objects. As a result, pylint applies the wrong regex in validating names,
|
|
# and throws spurious errors. Therefore, we disable invalid-name checking.
|
|
# pylint: disable=invalid-name
|
|
|
|
|
|
########################## Prod-like settings ###################################
|
|
# These should be as close as possible to the settings we use in production.
|
|
# As in prod, we read in environment and auth variables from JSON files.
|
|
# Unlike in prod, we use the JSON files stored in this repo.
|
|
# This is a convenience for ensuring (a) that we can consistently find the files
|
|
# and (b) that the files are the same in Jenkins as in local dev.
|
|
os.environ['SERVICE_VARIANT'] = 'bok_choy'
|
|
os.environ['CONFIG_ROOT'] = path(__file__).abspath().dirname() # pylint: disable=no-value-for-parameter
|
|
|
|
from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import
|
|
|
|
######################### Testing overrides ####################################
|
|
|
|
# Needed for the reset database management command
|
|
INSTALLED_APPS += ('django_extensions',)
|
|
|
|
# Redirect to the test_root folder within the repo
|
|
TEST_ROOT = CONFIG_ROOT.dirname().dirname() / "test_root" # pylint: disable=no-value-for-parameter
|
|
GITHUB_REPO_ROOT = (TEST_ROOT / "data").abspath()
|
|
LOG_DIR = (TEST_ROOT / "log").abspath()
|
|
|
|
# Configure modulestore to use the test folder within the repo
|
|
update_module_store_settings(
|
|
MODULESTORE,
|
|
module_store_options={
|
|
'fs_root': (TEST_ROOT / "data").abspath(), # pylint: disable=no-value-for-parameter
|
|
},
|
|
xml_store_options={
|
|
'data_dir': (TEST_ROOT / "data").abspath(),
|
|
},
|
|
default_store=os.environ.get('DEFAULT_STORE', 'draft'),
|
|
)
|
|
|
|
# Enable django-pipeline and staticfiles
|
|
STATIC_ROOT = (TEST_ROOT / "staticfiles").abspath()
|
|
|
|
# Silence noisy logs
|
|
import logging
|
|
LOG_OVERRIDES = [
|
|
('track.middleware', logging.CRITICAL),
|
|
('edx.discussion', logging.CRITICAL),
|
|
]
|
|
for log_name, log_level in LOG_OVERRIDES:
|
|
logging.getLogger(log_name).setLevel(log_level)
|
|
|
|
# Use the auto_auth workflow for creating users and logging them in
|
|
FEATURES['AUTOMATIC_AUTH_FOR_TESTING'] = True
|
|
|
|
# Enable milestones app
|
|
FEATURES['MILESTONES_APP'] = True
|
|
|
|
# Enable pre-requisite course
|
|
FEATURES['ENABLE_PREREQUISITE_COURSES'] = True
|
|
|
|
# Enable student notes
|
|
FEATURES['ENABLE_EDXNOTES'] = True
|
|
|
|
# Enable teams feature
|
|
FEATURES['ENABLE_TEAMS'] = True
|
|
|
|
# Enable custom content licensing
|
|
FEATURES['LICENSING'] = True
|
|
|
|
FEATURES['ENABLE_MOBILE_REST_API'] = True # Enable video bumper in Studio
|
|
FEATURES['ENABLE_VIDEO_BUMPER'] = True # Enable video bumper in Studio settings
|
|
|
|
########################### Entrance Exams #################################
|
|
FEATURES['ENTRANCE_EXAMS'] = True
|
|
|
|
# Unfortunately, we need to use debug mode to serve staticfiles
|
|
DEBUG = True
|
|
|
|
# Point the URL used to test YouTube availability to our stub YouTube server
|
|
YOUTUBE_PORT = 9080
|
|
YOUTUBE['API'] = "127.0.0.1:{0}/get_youtube_api/".format(YOUTUBE_PORT)
|
|
YOUTUBE['TEST_URL'] = "127.0.0.1:{0}/test_youtube/".format(YOUTUBE_PORT)
|
|
YOUTUBE['TEXT_API']['url'] = "127.0.0.1:{0}/test_transcripts_youtube/".format(YOUTUBE_PORT)
|
|
|
|
FEATURES['ENABLE_COURSEWARE_INDEX'] = True
|
|
FEATURES['ENABLE_LIBRARY_INDEX'] = True
|
|
SEARCH_ENGINE = "search.tests.mock_search_engine.MockSearchEngine"
|
|
# Path at which to store the mock index
|
|
MOCK_SEARCH_BACKING_FILE = (
|
|
TEST_ROOT / "index_file.dat" # pylint: disable=no-value-for-parameter
|
|
).abspath()
|
|
|
|
# Generate a random UUID so that different runs of acceptance tests don't break each other
|
|
import uuid
|
|
SECRET_KEY = uuid.uuid4().hex
|
|
|
|
#####################################################################
|
|
# Lastly, see if the developer has any local overrides.
|
|
try:
|
|
from .private import * # pylint: disable=import-error
|
|
except ImportError:
|
|
pass
|