fix logs (and import)
This commit is contained in:
@@ -24,13 +24,13 @@ def test_loguru_uses_django_file_handler_path(settings, tmp_path, monkeypatch):
|
||||
def test_logs_view_filters_by_date_and_can_reset_log_file(client, admin_user, monkeypatch, tmp_path):
|
||||
client.force_login(admin_user)
|
||||
|
||||
log_file = tmp_path / "log.txt"
|
||||
log_file = tmp_path / "app.log"
|
||||
log_file.write_text(
|
||||
"[03/Jun/2026 10:00:00] INFO [atlas.views:10] first entry\n"
|
||||
"[03/Jun/2026 11:00:00] ERROR [atlas.views:11] second entry\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
monkeypatch.setattr("rad.views.settings.BASE_DIR", str(tmp_path))
|
||||
monkeypatch.setattr("rad.views.get_log_file_path", lambda: log_file)
|
||||
|
||||
response = client.get(
|
||||
reverse("logs_view"),
|
||||
|
||||
Reference in New Issue
Block a user