try to fix logging
This commit is contained in:
@@ -3,6 +3,22 @@ from __future__ import annotations
|
||||
import pytest
|
||||
from django.urls import reverse
|
||||
|
||||
from rad import logging_setup
|
||||
|
||||
|
||||
def test_loguru_uses_django_file_handler_path(settings, tmp_path, monkeypatch):
|
||||
monkeypatch.setattr(logging_setup, "_CONFIGURED", False)
|
||||
settings.BASE_DIR = str(tmp_path)
|
||||
settings.LOGGING = {
|
||||
"handlers": {
|
||||
"file": {
|
||||
"filename": "log.txt",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
assert logging_setup._get_log_file_path() == tmp_path / "log.txt"
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_logs_view_filters_by_date_and_can_reset_log_file(client, admin_user, monkeypatch, tmp_path):
|
||||
|
||||
Reference in New Issue
Block a user