Chore: Bulk backend dependency updates (#8212)

This commit is contained in:
Trenton H
2024-11-11 11:54:51 -08:00
committed by GitHub
parent a6f4c75a72
commit d1f255a22e
8 changed files with 1883 additions and 1514 deletions

View File

@@ -243,21 +243,29 @@ class TestSystemStatus(APITestCase):
THEN:
- The response contains an ERROR classifier status
"""
does_exist = tempfile.NamedTemporaryFile(
dir="/tmp",
delete=False,
)
with override_settings(MODEL_FILE=does_exist):
with (
tempfile.NamedTemporaryFile(
dir="/tmp",
delete=False,
) as does_exist,
override_settings(MODEL_FILE=does_exist),
):
with mock.patch("documents.classifier.load_classifier") as mock_load:
mock_load.side_effect = ClassifierModelCorruptError()
Document.objects.create(
title="Test Document",
)
Tag.objects.create(name="Test Tag", matching_algorithm=Tag.MATCH_AUTO)
Tag.objects.create(
name="Test Tag",
matching_algorithm=Tag.MATCH_AUTO,
)
self.client.force_login(self.user)
response = self.client.get(self.ENDPOINT)
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data["tasks"]["classifier_status"], "ERROR")
self.assertEqual(
response.data["tasks"]["classifier_status"],
"ERROR",
)
self.assertIsNotNone(response.data["tasks"]["classifier_error"])
def test_system_status_classifier_ok_no_objects(self):