Update status test for index to use path

This commit is contained in:
shamoon 2024-03-03 22:08:45 -08:00
parent 914db68e5e
commit 42d9da149f

View File

@ -1,4 +1,5 @@
import os import os
from pathlib import Path
from unittest import mock from unittest import mock
from django.contrib.auth.models import User from django.contrib.auth.models import User
@ -111,7 +112,7 @@ class TestSystemStatus(APITestCase):
self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data["tasks"]["celery_status"], "OK") self.assertEqual(response.data["tasks"]["celery_status"], "OK")
@override_settings(INDEX_DIR="/tmp/index") @override_settings(INDEX_DIR=Path("/tmp/index"))
@mock.patch("whoosh.index.FileIndex.last_modified") @mock.patch("whoosh.index.FileIndex.last_modified")
def test_system_status_index_ok(self, mock_last_modified): def test_system_status_index_ok(self, mock_last_modified):
""" """