#88 #89 : use pytest + reorganise settings (#92)

- !88 pytest on existing tests
- !89 reorganise settings (! see notes for deployment)

Co-authored-by: bkfox <thomas bkfox net>
Reviewed-on: rc/aircox#92
This commit is contained in:
Thomas Kairos
2023-03-28 14:40:49 +02:00
parent 4bebc56a28
commit 0e183099ed
31 changed files with 511 additions and 368 deletions

View File

@ -10,8 +10,9 @@ from django.utils import timezone as tz
from django.utils.functional import cached_property
from django.utils.translation import gettext_lazy as _
from aircox import settings
from aircox.conf import settings
__all__ = ("Settings", "settings")
from .episode import Diffusion
from .sound import Sound, Track
from .station import Station
@ -251,7 +252,7 @@ class LogArchiver:
@staticmethod
def get_path(station, date):
return os.path.join(
settings.AIRCOX_LOGS_ARCHIVES_DIR,
settings.LOGS_ARCHIVES_DIR_ABS,
"{}_{}.log.gz".format(date.strftime("%Y%m%d"), station.pk),
)
@ -264,7 +265,7 @@ class LogArchiver:
if not qs.exists():
return 0
os.makedirs(settings.AIRCOX_LOGS_ARCHIVES_DIR, exist_ok=True)
os.makedirs(settings.LOGS_ARCHIVES_DIR_ABS, exist_ok=True)
count = qs.count()
logs = self.sort_logs(qs)