# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import os import socket import sys import django from django.utils import html_parser from openstack_dashboard.static_settings import get_staticfiles_dirs # noqa from horizon.test import patches STATICFILES_DIRS = get_staticfiles_dirs() # Patch django.utils.html_parser.HTMLParser as a workaround for bug 1273943 if django.get_version() == '1.4' and sys.version_info[:3] > (2, 7, 3): html_parser.HTMLParser.parse_starttag = patches.parse_starttag_patched socket.setdefaulttimeout(1) LOGIN_URL = '/auth/login/' LOGOUT_URL = '/auth/logout/' LOGIN_REDIRECT_URL = '/' ROOT_PATH = os.path.dirname(os.path.abspath(__file__)) STATIC_ROOT = os.path.abspath(os.path.join(ROOT_PATH, '..', 'static')) DEBUG = False
MEDIA_URL = WEBROOT + 'media/' if STATIC_ROOT is None: STATIC_ROOT = os.path.abspath(os.path.join(ROOT_PATH, '..', 'static')) if STATIC_URL is None: STATIC_URL = WEBROOT + 'static/' AVAILABLE_THEMES, DEFAULT_THEME = theme_settings.get_available_themes( AVAILABLE_THEMES, CUSTOM_THEME_PATH, DEFAULT_THEME_PATH, DEFAULT_THEME ) STATICFILES_DIRS = get_staticfiles_dirs(STATIC_URL) + \ theme_settings.get_theme_static_dirs( AVAILABLE_THEMES, THEME_COLLECTION_DIR, ROOT_PATH) if CUSTOM_THEME_PATH is not None: logging.warning("CUSTOM_THEME_PATH has been deprecated. Please convert " "your settings to make use of AVAILABLE_THEMES.") if DEFAULT_THEME_PATH is not None: logging.warning("DEFAULT_THEME_PATH has been deprecated. Please convert " "your settings to make use of AVAILABLE_THEMES.") # populate HORIZON_CONFIG with auto-discovered JavaScript sources, mock files, # specs files and external templates.
# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import os from horizon.test.settings import * # noqa from horizon.utils import secret_key from openstack_dashboard import exceptions from openstack_dashboard.static_settings import get_staticfiles_dirs # noqa STATICFILES_DIRS = get_staticfiles_dirs() TEST_DIR = os.path.dirname(os.path.abspath(__file__)) ROOT_PATH = os.path.abspath(os.path.join(TEST_DIR, "..")) STATIC_ROOT = os.path.abspath(os.path.join(ROOT_PATH, '..', 'static')) SECRET_KEY = secret_key.generate_or_read_from_file( os.path.join(TEST_DIR, '.secret_key_store')) ROOT_URLCONF = 'openstack_dashboard.test.urls' TEMPLATE_DIRS = ( os.path.join(TEST_DIR, 'templates'), ) TEMPLATE_CONTEXT_PROCESSORS += ( 'openstack_dashboard.context_processors.openstack', )
MEDIA_URL = WEBROOT + 'media/' if STATIC_ROOT is None: STATIC_ROOT = os.path.abspath(os.path.join(ROOT_PATH, '..', 'static')) if STATIC_URL is None: STATIC_URL = WEBROOT + 'static/' AVAILABLE_THEMES, DEFAULT_THEME = theme_settings.get_available_themes( AVAILABLE_THEMES, CUSTOM_THEME_PATH, DEFAULT_THEME_PATH, DEFAULT_THEME ) STATICFILES_DIRS = get_staticfiles_dirs(STATIC_URL) + \ theme_settings.get_theme_static_dirs( AVAILABLE_THEMES, THEME_COLLECTION_DIR, ROOT_PATH) if CUSTOM_THEME_PATH is not None: logging.warning("CUSTOM_THEME_PATH has been deprecated. Please convert " "your settings to make use of AVAILABLE_THEMES.") if DEFAULT_THEME_PATH is not None: logging.warning("DEFAULT_THEME_PATH has been deprecated. Please convert " "your settings to make use of AVAILABLE_THEMES.") # populate HORIZON_CONFIG with auto-discovered JavaScript sources, mock files, # specs files and external templates.