2023-07-21 14:58:05 +00:00
|
|
|
# flake8: noqa: E405
|
|
|
|
"""
|
|
|
|
Settings used to run tests
|
|
|
|
"""
|
|
|
|
import os
|
2021-09-29 17:17:52 +00:00
|
|
|
|
2023-07-21 14:58:05 +00:00
|
|
|
from inventory_project.settings.prod import * # noqa
|
|
|
|
|
|
|
|
|
2025-03-23 11:35:37 +00:00
|
|
|
ALLOWED_HOSTS = ['testserver']
|
|
|
|
|
|
|
|
|
2023-07-21 14:58:05 +00:00
|
|
|
# _____________________________________________________________________________
|
|
|
|
# Manage Django Project
|
|
|
|
|
|
|
|
INSTALLED_APPS.append('manage_django_project')
|
|
|
|
|
|
|
|
# _____________________________________________________________________________
|
2020-11-01 15:40:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
DATABASES = {
|
|
|
|
'default': {
|
|
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
|
|
'NAME': ':memory:',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-09-05 16:00:48 +00:00
|
|
|
SECRET_KEY = 'No individual secret for tests ;)'
|
|
|
|
|
2023-07-21 14:58:05 +00:00
|
|
|
DEBUG = True
|
|
|
|
|
|
|
|
# Speedup tests by change the Password hasher:
|
|
|
|
PASSWORD_HASHERS = ('django.contrib.auth.hashers.MD5PasswordHasher',)
|
2020-11-01 15:40:08 +00:00
|
|
|
|
2023-07-21 14:58:05 +00:00
|
|
|
# _____________________________________________________________________________
|
2021-12-05 15:10:54 +00:00
|
|
|
|
2021-09-29 17:17:52 +00:00
|
|
|
|
2023-07-21 14:58:05 +00:00
|
|
|
# All tests should use django-override-storage!
|
|
|
|
# Set root to not existing path, so that wrong tests will fail:
|
|
|
|
STATIC_ROOT = '/not/exists/static/'
|
|
|
|
MEDIA_ROOT = '/not/exists/media/'
|
2022-06-20 17:22:58 +00:00
|
|
|
|
|
|
|
|
2023-07-21 14:58:05 +00:00
|
|
|
# _____________________________________________________________________________
|
|
|
|
# Playwright
|
|
|
|
# Avoid django.core.exceptions.SynchronousOnlyOperation. Playwright uses an event loop,
|
|
|
|
# even when using he sync API. Django only checks whether _any_ event loop is running,
|
|
|
|
# but not if _itself_ is running in an even loop.
|
|
|
|
# see https://github.com/microsoft/playwright-python/issues/439#issuecomment-763339612.
|
|
|
|
os.environ.setdefault('DJANGO_ALLOW_ASYNC_UNSAFE', '1')
|