Fixes that broken test
This commit is contained in:
parent
ec3126be9c
commit
9eae84e2d2
@ -1301,9 +1301,13 @@ class TestDocumentApi(DirectoriesMixin, DocumentConsumeDelayMixin, APITestCase):
|
||||
|
||||
settings.MODEL_FILE.touch()
|
||||
|
||||
classifier_checksum = b"thisisachecksum"
|
||||
|
||||
mocked_load.return_value = mock.Mock(last_auto_type_hash=classifier_checksum)
|
||||
|
||||
last_modified = timezone.now()
|
||||
cache.set(CLASSIFIER_MODIFIED_KEY, last_modified, CACHE_50_MINUTES)
|
||||
cache.set(CLASSIFIER_HASH_KEY, "thisisachecksum", CACHE_50_MINUTES)
|
||||
cache.set(CLASSIFIER_HASH_KEY, classifier_checksum, CACHE_50_MINUTES)
|
||||
cache.set(
|
||||
CLASSIFIER_VERSION_KEY,
|
||||
DocumentClassifier.FORMAT_VERSION,
|
||||
@ -1342,7 +1346,7 @@ class TestDocumentApi(DirectoriesMixin, DocumentConsumeDelayMixin, APITestCase):
|
||||
self.assertIn("ETag", response.headers)
|
||||
self.assertEqual(
|
||||
response.headers["ETag"],
|
||||
f'"thisisachecksum:{settings.NUMBER_OF_SUGGESTED_DATES}"',
|
||||
f'"{classifier_checksum}:{settings.NUMBER_OF_SUGGESTED_DATES}"',
|
||||
)
|
||||
|
||||
response = self.client.get(f"/api/documents/{doc.pk}/suggestions/")
|
||||
|
Loading…
x
Reference in New Issue
Block a user