mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-06-10 07:39:50 +00:00
drop conftest use pytest_env thing
This commit is contained in:
@@ -309,6 +309,7 @@ markers = [
|
||||
[tool.pytest_env]
|
||||
PAPERLESS_DISABLE_DBHANDLER = "true"
|
||||
PAPERLESS_CACHE_BACKEND = "django.core.cache.backends.locmem.LocMemCache"
|
||||
PAPERLESS_CHANNELS_BACKEND = "channels.layers.InMemoryChannelLayer"
|
||||
|
||||
[tool.coverage.report]
|
||||
exclude_also = [
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
import pytest
|
||||
from pytest_django.fixtures import SettingsWrapper
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def in_memory_channel_layers(settings: SettingsWrapper) -> None:
|
||||
settings.CHANNEL_LAYERS = {
|
||||
"default": {
|
||||
"BACKEND": "channels.layers.InMemoryChannelLayer",
|
||||
},
|
||||
}
|
||||
@@ -491,18 +491,24 @@ TEMPLATES = [
|
||||
},
|
||||
]
|
||||
|
||||
_CHANNELS_BACKEND = os.environ.get(
|
||||
"PAPERLESS_CHANNELS_BACKEND",
|
||||
"channels_redis.pubsub.RedisPubSubChannelLayer",
|
||||
)
|
||||
CHANNEL_LAYERS = {
|
||||
"default": {
|
||||
"BACKEND": "channels_redis.pubsub.RedisPubSubChannelLayer",
|
||||
"CONFIG": {
|
||||
"hosts": [_CHANNELS_REDIS_URL],
|
||||
"capacity": 2000, # default 100
|
||||
"expiry": 15, # default 60
|
||||
"prefix": _REDIS_KEY_PREFIX,
|
||||
},
|
||||
"BACKEND": _CHANNELS_BACKEND,
|
||||
},
|
||||
}
|
||||
|
||||
if _CHANNELS_BACKEND.startswith("channels_redis."):
|
||||
CHANNEL_LAYERS["default"]["CONFIG"] = {
|
||||
"hosts": [_CHANNELS_REDIS_URL],
|
||||
"capacity": 2000, # default 100
|
||||
"expiry": 15, # default 60
|
||||
"prefix": _REDIS_KEY_PREFIX,
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Email (SMTP) Backend #
|
||||
###############################################################################
|
||||
|
||||
Reference in New Issue
Block a user