test.py 19.5 KB
Newer Older
1
# -*- coding: utf-8 -*-
2 3 4 5 6 7
"""
This config file runs the simplest dev environment using sqlite, and db-based
sessions. Assumes structure:

/envroot/
        /db   # This is where it'll write the database file
8
        /edx-platform  # The location of this repo
9 10
        /log  # Where we're going to write log files
"""
11 12 13

# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
14
# pylint: disable=wildcard-import, unused-wildcard-import
15

16 17 18 19 20
# 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

21
from .common import *
22
import os
23
from path import Path as path
24
from uuid import uuid4
25
from warnings import filterwarnings, simplefilter
26

27
from util.db import NoOpMigrationModules
28 29
from openedx.core.lib.tempdir import mkdtemp_clean

30
# This patch disables the commit_on_success decorator during tests
31
# in TestCase subclasses.
32
from util.testing import patch_testcase, patch_sessions
33
patch_testcase()
34
patch_sessions()
35

36 37 38 39 40 41 42 43 44
# Silence noisy logs to make troubleshooting easier when tests fail.
import logging
LOG_OVERRIDES = [
    ('factory.generate', logging.ERROR),
    ('factory.containers', logging.ERROR),
]
for log_name, log_level in LOG_OVERRIDES:
    logging.getLogger(log_name).setLevel(log_level)

45 46 47 48
# mongo connection settings
MONGO_PORT_NUM = int(os.environ.get('EDXAPP_TEST_MONGO_PORT', '27017'))
MONGO_HOST = os.environ.get('EDXAPP_TEST_MONGO_HOST', 'localhost')

49 50
os.environ['DJANGO_LIVE_TEST_SERVER_ADDRESS'] = 'localhost:8000-9000'

51 52
THIS_UUID = uuid4().hex[:5]

53 54
# can't test start dates with this True, but on the other hand,
# can test everything else :)
55
FEATURES['DISABLE_START_DATES'] = True
56

57 58
# Most tests don't use the discussion service, so we turn it off to speed them up.
# Tests that do can enable this flag, but must use the UrlResetMixin class to force urls.py
59 60
# to reload. For consistency in user-experience, keep the value of this setting in sync with
# the one in cms/envs/test.py
61
FEATURES['ENABLE_DISCUSSION_SERVICE'] = False
62

63
FEATURES['ENABLE_SERVICE_STATUS'] = True
64

65
FEATURES['ENABLE_SHOPPING_CART'] = True
66

67 68
FEATURES['ENABLE_VERIFIED_CERTIFICATES'] = True

69
# Enable this feature for course staff grade downloads, to enable acceptance tests
70
FEATURES['ENABLE_GRADE_DOWNLOADS'] = True
71 72
FEATURES['ALLOW_COURSE_STAFF_GRADE_DOWNLOADS'] = True

73 74 75
# Toggles embargo on for testing
FEATURES['EMBARGO'] = True

76 77
FEATURES['ENABLE_COMBINED_LOGIN_REGISTRATION'] = True

78 79 80
# Enable the milestones app in tests to be consistent with it being enabled in production
FEATURES['MILESTONES_APP'] = True

81 82 83
# Need wiki for courseware views to work. TODO (vshnayder): shouldn't need it.
WIKI_ENABLED = True

84 85 86
# Enable a parental consent age limit for testing
PARENTAL_CONSENT_AGE_LIMIT = 13

87
# Makes the tests run much faster...
88
SOUTH_TESTS_MIGRATE = False  # To disable migrations and use syncdb instead
89

90
# Nose Test Runner
91
TEST_RUNNER = 'openedx.core.djangolib.nose.NoseTestSuiteRunner'
92

93
_SYSTEM = 'lms'
94

95 96
_REPORT_DIR = REPO_ROOT / 'reports' / _SYSTEM
_REPORT_DIR.makedirs_p()
97 98
_NOSEID_DIR = REPO_ROOT / '.testids' / _SYSTEM
_NOSEID_DIR.makedirs_p()
99 100

NOSE_ARGS = [
101
    '--id-file', _NOSEID_DIR / 'noseids',
102 103
]

104 105 106 107
NOSE_PLUGINS = [
    'openedx.core.djangolib.testing.utils.NoseDatabaseIsolation'
]

108
# Local Directories
109
TEST_ROOT = path("test_root")
110
# Want static files in the same dir for running on jenkins.
111
STATIC_ROOT = TEST_ROOT / "staticfiles"
112

113 114
STATUS_MESSAGE_PATH = TEST_ROOT / "status_message.json"

115
COURSES_ROOT = TEST_ROOT / "data"
116 117
DATA_DIR = COURSES_ROOT

118
COMMON_TEST_DATA_ROOT = COMMON_ROOT / "test" / "data"
119
# Where the content data is checked out.  This may not exist on jenkins.
120
GITHUB_REPO_ROOT = ENV_ROOT / "data"
121

122
USE_I18N = True
123
LANGUAGE_CODE = 'en'  # tests assume they will get English.
124

125
XQUEUE_INTERFACE = {
126
    "url": "http://sandbox-xqueue.edx.org",
127
    "django_auth": {
128 129
        "username": "lms",
        "password": "***REMOVED***"
130 131
    },
    "basic_auth": ('anant', 'agarwal'),
132
}
133
XQUEUE_WAITTIME_BETWEEN_REQUESTS = 5  # seconds
134

Victor Shnayder committed
135 136
# Don't rely on a real staff grading backend
MOCK_STAFF_GRADING = True
137
MOCK_PEER_GRADING = True
138

139 140
############################ STATIC FILES #############################

141 142
# TODO (cpennington): We need to figure out how envs/test.py can inject things
# into common.py so that we don't have to repeat this sort of thing
143 144 145 146 147 148 149 150 151 152
STATICFILES_DIRS = [
    COMMON_ROOT / "static",
    PROJECT_ROOT / "static",
]
STATICFILES_DIRS += [
    (course_dir, COMMON_TEST_DATA_ROOT / course_dir)
    for course_dir in os.listdir(COMMON_TEST_DATA_ROOT)
    if os.path.isdir(COMMON_TEST_DATA_ROOT / course_dir)
]

153 154 155 156
# Avoid having to run collectstatic before the unit test suite
# If we don't add these settings, then Django templates that can't
# find pipelined assets will raise a ValueError.
# http://stackoverflow.com/questions/12816941/unit-testing-with-django-pipeline
157
STATICFILES_STORAGE = 'pipeline.storage.NonPackagingPipelineStorage'
158 159 160

# Don't use compression during tests
PIPELINE_JS_COMPRESSOR = None
161

162 163 164 165 166 167
update_module_store_settings(
    MODULESTORE,
    module_store_options={
        'fs_root': TEST_ROOT / "data",
    },
    xml_store_options={
168
        'data_dir': mkdtemp_clean(dir=TEST_ROOT),  # never inadvertently load all the XML courses
169 170
    },
    doc_store_settings={
171 172
        'host': MONGO_HOST,
        'port': MONGO_PORT_NUM,
173 174
        'db': 'test_xmodule_{}'.format(THIS_UUID),
        'collection': 'test_modulestore',
175 176
    },
)
177

178 179
CONTENTSTORE = {
    'ENGINE': 'xmodule.contentstore.mongo.MongoContentStore',
180
    'DOC_STORE_CONFIG': {
181
        'host': MONGO_HOST,
182
        'db': 'test_xcontent_{}'.format(THIS_UUID),
183
        'port': MONGO_PORT_NUM,
184 185
    }
}
186

187 188
DATABASES = {
    'default': {
189
        'ENGINE': 'django.db.backends.sqlite3',
190
        'ATOMIC_REQUESTS': True,
191
    },
192 193 194
    'student_module_history': {
        'ENGINE': 'django.db.backends.sqlite3',
    },
195 196
}

197 198 199 200
if os.environ.get('DISABLE_MIGRATIONS'):
    # Create tables directly from apps' models. This can be removed once we upgrade
    # to Django 1.9, which allows setting MIGRATION_MODULES to None in order to skip migrations.
    MIGRATION_MODULES = NoOpMigrationModules()
201

202 203 204 205
# Make sure we test with the extended history table
FEATURES['ENABLE_CSMH_EXTENDED'] = True
INSTALLED_APPS += ('coursewarehistoryextended',)

206
CACHES = {
Victor Shnayder committed
207
    # This is the cache used for most things.
208 209
    # In staging/prod envs, the sessions also live here.
    'default': {
210
        'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
211 212 213 214 215 216 217 218 219
    },

    # The general cache is what you get if you use our util.cache. It's used for
    # things like caching the course.xml file for different A/B test groups.
    # We set it to be a DummyCache to force reloading of course.xml in dev.
    # In staging environments, we would grab VERSION from data uploaded by the
    # push process.
    'general': {
        'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
220 221 222
    },

    'mongo_metadata_inheritance': {
223
        'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
224 225
    },
    'loc_cache': {
226
        'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
227
    },
228 229 230
    'course_structure_cache': {
        'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
    },
231 232 233 234 235
}

# Dummy secret key for dev
SECRET_KEY = '85920908f28904ed733fe576320db18cabd7b6cd'

Diana Huang committed
236 237 238
# hide ratelimit warnings while running tests
filterwarnings('ignore', message='No request passed to the backend, unable to rate-limit')

239 240
# Ignore deprecation warnings (so we don't clutter Jenkins builds/production)
# https://docs.python.org/2/library/warnings.html#the-warnings-filter
David Baumgold committed
241 242
# Change to "default" to see the first instance of each hit
# or "error" to convert all into errors
243
simplefilter('ignore')
244

245 246 247 248 249 250 251 252 253 254 255
############################# SECURITY SETTINGS ################################
# Default to advanced security in common.py, so tests can reset here to use
# a simpler security model
FEATURES['ENFORCE_PASSWORD_POLICY'] = False
FEATURES['ENABLE_MAX_FAILED_LOGIN_ATTEMPTS'] = False
FEATURES['SQUELCH_PII_IN_LOGS'] = False
FEATURES['PREVENT_CONCURRENT_LOGINS'] = False
FEATURES['ADVANCED_SECURITY'] = False
PASSWORD_MIN_LENGTH = None
PASSWORD_COMPLEXITY = {}

256 257 258
######### Third-party auth ##########
FEATURES['ENABLE_THIRD_PARTY_AUTH'] = True

259 260 261 262
AUTHENTICATION_BACKENDS = (
    'social.backends.google.GoogleOAuth2',
    'social.backends.linkedin.LinkedinOAuth2',
    'social.backends.facebook.FacebookOAuth2',
263
    'social.backends.azuread.AzureADOAuth2',
264
    'social.backends.twitter.TwitterOAuth',
265 266
    'third_party_auth.dummy.DummyBackend',
    'third_party_auth.saml.SAMLAuthBackend',
267
    'third_party_auth.lti.LTIAuthBackend',
268
) + AUTHENTICATION_BACKENDS
269

270 271 272 273 274 275 276 277
THIRD_PARTY_AUTH_CUSTOM_AUTH_FORMS = {
    'custom1': {
        'secret_key': 'opensesame',
        'url': '/misc/my-custom-registration-form',
        'error_url': '/misc/my-custom-sso-error-page'
    },
}

278
################################## OPENID #####################################
279 280
FEATURES['AUTH_USE_OPENID'] = True
FEATURES['AUTH_USE_OPENID_PROVIDER'] = True
281

282
################################## SHIB #######################################
283 284 285
FEATURES['AUTH_USE_SHIB'] = True
FEATURES['SHIB_DISABLE_TOS'] = True
FEATURES['RESTRICT_ENROLL_BY_REG_METHOD'] = True
286

287 288 289
OPENID_CREATE_USERS = False
OPENID_UPDATE_DETAILS_FROM_SREG = True
OPENID_USE_AS_ADMIN_LOGIN = False
290 291
OPENID_PROVIDER_TRUSTED_ROOTS = ['*']

292 293
############################## OAUTH2 Provider ################################
FEATURES['ENABLE_OAUTH2_PROVIDER'] = True
294 295
# don't cache courses for testing
OIDC_COURSE_HANDLER_CACHE_TIMEOUT = 0
296

297 298 299 300
########################### External REST APIs #################################
FEATURES['ENABLE_MOBILE_REST_API'] = True
FEATURES['ENABLE_VIDEO_ABSTRACTION_LAYER_API'] = True

301 302
###################### Payment ##############################3
# Enable fake payment processing page
303
FEATURES['ENABLE_PAYMENT_FAKE'] = True
304

305 306 307 308 309
# Configure the payment processor to use the fake processing page
# Since both the fake payment page and the shoppingcart app are using
# the same settings, we can generate this randomly and guarantee
# that they are using the same secret.
from random import choice
310
from string import letters, digits, punctuation
311
RANDOM_SHARED_SECRET = ''.join(
312
    choice(letters + digits + punctuation)
313 314 315
    for x in range(250)
)

316 317 318 319 320 321 322
CC_PROCESSOR_NAME = 'CyberSource2'
CC_PROCESSOR['CyberSource2']['SECRET_KEY'] = RANDOM_SHARED_SECRET
CC_PROCESSOR['CyberSource2']['ACCESS_KEY'] = "0123456789012345678901"
CC_PROCESSOR['CyberSource2']['PROFILE_ID'] = "edx"
CC_PROCESSOR['CyberSource2']['PURCHASE_ENDPOINT'] = "/shoppingcart/payment_fake"

FEATURES['STORE_BILLING_INFO'] = True
323

Carson Gee committed
324 325 326 327
########################### SYSADMIN DASHBOARD ################################
FEATURES['ENABLE_SYSADMIN_DASHBOARD'] = True
GIT_REPO_DIR = TEST_ROOT / "course_repos"

328 329 330
################################# CELERY ######################################

CELERY_ALWAYS_EAGER = True
Feanil Patel committed
331
CELERY_RESULT_BACKEND = 'djcelery.backends.cache:CacheBackend'
332

333 334 335 336 337
######################### MARKETING SITE ###############################

MKTG_URL_LINK_MAP = {
    'ABOUT': 'about',
    'CONTACT': 'contact',
Peter Fogg committed
338
    'HELP_CENTER': 'help-center',
339 340 341 342 343
    'COURSES': 'courses',
    'ROOT': 'root',
    'TOS': 'tos',
    'HONOR': 'honor',
    'PRIVACY': 'privacy',
Peter Fogg committed
344
    'CAREERS': 'careers',
345 346 347 348
    'NEWS': 'news',
    'PRESS': 'press',
    'BLOG': 'blog',
    'DONATE': 'donate',
349
    'SITEMAP.XML': 'sitemap_xml',
350 351 352 353 354

    # Verified Certificates
    'WHAT_IS_VERIFIED_CERT': 'verified-certificate',
}

Peter Fogg committed
355
SUPPORT_SITE_LINK = 'https://support.example.com'
356

357
############################ STATIC FILES #############################
358
DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
359
MEDIA_ROOT = TEST_ROOT / "uploads"
360 361
MEDIA_URL = "/static/uploads/"
STATICFILES_DIRS.append(("uploads", MEDIA_ROOT))
362

363
_NEW_STATICFILES_DIRS = []
364
# Strip out any static files that aren't in the repository root
365
# so that the tests can run with only the edx-platform directory checked out
366 367 368 369 370 371 372
for static_dir in STATICFILES_DIRS:
    # Handle both tuples and non-tuple directory definitions
    try:
        _, data_dir = static_dir
    except ValueError:
        data_dir = static_dir

373
    if data_dir.startswith(REPO_ROOT):
374 375
        _NEW_STATICFILES_DIRS.append(static_dir)
STATICFILES_DIRS = _NEW_STATICFILES_DIRS
376

377
FILE_UPLOAD_TEMP_DIR = TEST_ROOT / "uploads"
378 379 380 381
FILE_UPLOAD_HANDLERS = (
    'django.core.files.uploadhandler.MemoryFileUploadHandler',
    'django.core.files.uploadhandler.TemporaryFileUploadHandler',
)
382

383 384 385 386 387 388 389 390
########################### Server Ports ###################################

# These ports are carefully chosen so that if the browser needs to
# access them, they will be available through the SauceLabs SSH tunnel
LETTUCE_SERVER_PORT = 8003
XQUEUE_PORT = 8040
YOUTUBE_PORT = 8031
LTI_PORT = 8765
391
VIDEO_SOURCE_PORT = 8777
392

393 394 395 396 397 398 399 400
FEATURES['PREVIEW_LMS_BASE'] = "preview.localhost"
############### Module Store Items ##########
PREVIEW_DOMAIN = FEATURES['PREVIEW_LMS_BASE'].split(':')[0]
HOSTNAME_MODULESTORE_DEFAULT_MAPPINGS = {
    PREVIEW_DOMAIN: 'draft-preferred'
}


401 402 403 404 405 406 407 408 409 410 411
################### Make tests faster

#http://slacy.com/blog/2012/04/make-your-tests-faster-in-django-1-4/
PASSWORD_HASHERS = (
    # 'django.contrib.auth.hashers.PBKDF2PasswordHasher',
    # 'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
    # 'django.contrib.auth.hashers.BCryptPasswordHasher',
    'django.contrib.auth.hashers.SHA1PasswordHasher',
    'django.contrib.auth.hashers.MD5PasswordHasher',
    # 'django.contrib.auth.hashers.CryptPasswordHasher',
)
412

413 414 415
### This enables the Metrics tab for the Instructor dashboard ###########
FEATURES['CLASS_DASHBOARD'] = True

416 417 418 419 420 421
################### Make tests quieter

# OpenID spews messages like this to stderr, we don't need to see them:
#   Generated checkid_setup request to http://testserver/openid/provider/login/ with assocication {HMAC-SHA1}{51d49995}{s/kRmA==}

import openid.oidutil
stv committed
422
openid.oidutil.log = lambda message, level=0: None
423

424 425 426
PLATFORM_NAME = "edX"
SITE_NAME = "edx.org"

427
# set up some testing for microsites
428
FEATURES['USE_MICROSITES'] = True
429
MICROSITE_ROOT_DIR = COMMON_ROOT / 'test' / 'test_sites'
430
MICROSITE_CONFIGURATION = {
431 432 433 434 435 436 437
    "test_site": {
        "domain_prefix": "test-site",
        "university": "test_site",
        "platform_name": "Test Site",
        "logo_image_url": "test_site/images/header-logo.png",
        "email_from_address": "test_site@edx.org",
        "payment_support_email": "test_site@edx.org",
438
        "ENABLE_MKTG_SITE": False,
439 440
        "SITE_NAME": "test_site.localhost",
        "course_org_filter": "TestSiteX",
441
        "course_about_show_social_links": False,
442
        "css_overrides_file": "test_site/css/test_site.css",
443 444
        "show_partners": False,
        "show_homepage_promo_video": False,
445 446 447
        "course_index_overlay_text": "This is a Test Site Overlay Text.",
        "course_index_overlay_logo_file": "test_site/images/header-logo.png",
        "homepage_overlay_html": "<h1>This is a Test Site Overlay HTML</h1>",
448
        "ALWAYS_REDIRECT_HOMEPAGE_TO_DASHBOARD_FOR_AUTHENTICATED_USER": False,
449 450
        "COURSE_CATALOG_VISIBILITY_PERMISSION": "see_in_catalog",
        "COURSE_ABOUT_VISIBILITY_PERMISSION": "see_about_page",
451 452
        "ENABLE_SHOPPING_CART": True,
        "ENABLE_PAID_COURSE_REGISTRATION": True,
453
        "SESSION_COOKIE_DOMAIN": "test_site.localhost",
454 455
        "LINKEDIN_COMPANY_ID": "test",
        "FACEBOOK_APP_ID": "12345678908",
456
        "urls": {
457 458 459
            'ABOUT': 'test-site/about',
            'PRIVACY': 'test-site/privacy',
            'TOS_AND_HONOR': 'test-site/tos-and-honor',
460
        },
461
    },
462
    "site_with_logistration": {
463 464 465
        "domain_prefix": "logistration",
        "university": "logistration",
        "platform_name": "Test logistration",
466 467 468
        "logo_image_url": "test_site/images/header-logo.png",
        "email_from_address": "test_site@edx.org",
        "payment_support_email": "test_site@edx.org",
469 470
        "ENABLE_MKTG_SITE": False,
        "ENABLE_COMBINED_LOGIN_REGISTRATION": True,
471
        "SITE_NAME": "test_site.localhost",
472 473
        "course_org_filter": "LogistrationX",
        "course_about_show_social_links": False,
474
        "css_overrides_file": "test_site/css/test_site.css",
475 476 477
        "show_partners": False,
        "show_homepage_promo_video": False,
        "course_index_overlay_text": "Logistration.",
478
        "course_index_overlay_logo_file": "test_site/images/header-logo.png",
479 480 481 482 483 484 485 486
        "homepage_overlay_html": "<h1>This is a Logistration HTML</h1>",
        "ALWAYS_REDIRECT_HOMEPAGE_TO_DASHBOARD_FOR_AUTHENTICATED_USER": False,
        "COURSE_CATALOG_VISIBILITY_PERMISSION": "see_in_catalog",
        "COURSE_ABOUT_VISIBILITY_PERMISSION": "see_about_page",
        "ENABLE_SHOPPING_CART": True,
        "ENABLE_PAID_COURSE_REGISTRATION": True,
        "SESSION_COOKIE_DOMAIN": "test_logistration.localhost",
    },
487 488 489
    "default": {
        "university": "default_university",
        "domain_prefix": "www",
490 491
    }
}
492

493
MICROSITE_TEST_HOSTNAME = 'test-site.testserver'
494
MICROSITE_LOGISTRATION_HOSTNAME = 'logistration.testserver'
495

496 497
TEST_THEME = COMMON_ROOT / "test" / "test-theme"

498 499
# add extra template directory for test-only templates
MAKO_TEMPLATES['main'].extend([
500
    COMMON_ROOT / 'test' / 'templates',
501
    COMMON_ROOT / 'test' / 'test_sites',
502
    REPO_ROOT / 'openedx' / 'core' / 'djangolib' / 'tests' / 'templates',
503 504 505
])


506 507
# Setting for the testing of Software Secure Result Callback
VERIFY_STUDENT["SOFTWARE_SECURE"] = {
508 509
    "API_ACCESS_KEY": "BBBBBBBBBBBBBBBBBBBB",
    "API_SECRET_KEY": "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC",
510
}
511 512 513 514

VIDEO_CDN_URL = {
    'CN': 'http://api.xuetangx.com/edx/video?s3_url='
}
515 516 517 518 519 520 521 522 523

######### dashboard git log settings #########
MONGODB_LOG = {
    'host': MONGO_HOST,
    'port': MONGO_PORT_NUM,
    'user': '',
    'password': '',
    'db': 'xlog',
}
524

525 526
NOTES_DISABLED_TABS = []

527 528
# Enable EdxNotes for tests.
FEATURES['ENABLE_EDXNOTES'] = True
529

530 531 532
# Enable teams feature for tests.
FEATURES['ENABLE_TEAMS'] = True

533 534
# Enable courseware search for tests
FEATURES['ENABLE_COURSEWARE_SEARCH'] = True
535 536 537 538

# Enable dashboard search for tests
FEATURES['ENABLE_DASHBOARD_SEARCH'] = True

539 540
# Use MockSearchEngine as the search engine for test scenario
SEARCH_ENGINE = "search.tests.mock_search_engine.MockSearchEngine"
541 542 543 544

FACEBOOK_APP_SECRET = "Test"
FACEBOOK_APP_ID = "Test"
FACEBOOK_API_VERSION = "v2.2"
545

cewing committed
546
######### custom courses #########
Giovanni Di Milia committed
547
INSTALLED_APPS += ('lms.djangoapps.ccx', 'openedx.core.djangoapps.ccxcon')
548
FEATURES['CUSTOM_COURSES_EDX'] = True
549 550

# Set dummy values for profile image settings.
551 552 553 554 555 556 557
PROFILE_IMAGE_BACKEND = {
    'class': 'storages.backends.overwrite.OverwriteStorage',
    'options': {
        'location': MEDIA_ROOT,
        'base_url': 'http://example-storage.com/profile-images/',
    },
}
558
PROFILE_IMAGE_DEFAULT_FILENAME = 'default'
559
PROFILE_IMAGE_DEFAULT_FILE_EXTENSION = 'png'
560
PROFILE_IMAGE_SECRET_KEY = 'secret'
561 562
PROFILE_IMAGE_MAX_BYTES = 1024 * 1024
PROFILE_IMAGE_MIN_BYTES = 100
563 564 565 566

# Enable the LTI provider feature for testing
FEATURES['ENABLE_LTI_PROVIDER'] = True
INSTALLED_APPS += ('lti_provider',)
567
AUTHENTICATION_BACKENDS += ('lti_provider.users.LtiBackend',)
568 569 570

# ORGANIZATIONS
FEATURES['ORGANIZATIONS_APP'] = True
571 572 573

# Financial assistance page
FEATURES['ENABLE_FINANCIAL_ASSISTANCE_FORM'] = True
Ahsan Ulhaq committed
574 575 576 577 578 579

JWT_AUTH.update({
    'JWT_SECRET_KEY': 'test-secret',
    'JWT_ISSUER': 'https://test-provider/oauth2',
    'JWT_AUDIENCE': 'test-key',
})
580

581 582 583
# Set the default Oauth2 Provider Model so that migrations can run in
# verbose mode
OAUTH2_PROVIDER_APPLICATION_MODEL = 'oauth2_provider.Application'
584 585

COURSE_CATALOG_API_URL = 'https://catalog.example.com/api/v1'
586 587

COMPREHENSIVE_THEME_DIRS = [REPO_ROOT / "themes", REPO_ROOT / "common/test"]
588 589

LMS_ROOT_URL = "http://localhost:8000"