示例#1
0
# pylint: disable=invalid-name

from .common import *
import os
from path import Path as path
from uuid import uuid4
from warnings import filterwarnings, simplefilter

from util.db import NoOpMigrationModules
from openedx.core.lib.tempdir import mkdtemp_clean

# This patch disables the commit_on_success decorator during tests
# in TestCase subclasses.
from util.testing import patch_testcase, patch_sessions
patch_testcase()
patch_sessions()

# 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)

# 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')

os.environ['DJANGO_LIVE_TEST_SERVER_ADDRESS'] = 'localhost:8000-9000'
示例#2
0
from django.utils.translation import ugettext_lazy

from .common import *
import os
from path import Path as path
from uuid import uuid4

from util.db import NoOpMigrationModules
from openedx.core.lib.derived import derive_settings
from openedx.core.lib.tempdir import mkdtemp_clean

# This patch disables the commit_on_success decorator during tests
# in TestCase subclasses.
from util.testing import patch_testcase, patch_sessions
patch_testcase()
patch_sessions()

# Allow all hosts during tests, we use a lot of different ones all over the codebase.
ALLOWED_HOSTS = ['*']

# 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)

# mongo connection settings
MONGO_PORT_NUM = int(os.environ.get('EDXAPP_TEST_MONGO_PORT', '27017'))