mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-12 00:19:48 +00:00
Runs the pre-commit hooks over all the Python files
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
from django.test import TestCase
|
||||
|
||||
from documents import index
|
||||
from documents.models import Document
|
||||
from documents.tests.utils import DirectoriesMixin
|
||||
@@ -9,7 +8,9 @@ class TestAutoComplete(DirectoriesMixin, TestCase):
|
||||
def test_auto_complete(self):
|
||||
|
||||
doc1 = Document.objects.create(
|
||||
title="doc1", checksum="A", content="test test2 test3"
|
||||
title="doc1",
|
||||
checksum="A",
|
||||
content="test test2 test3",
|
||||
)
|
||||
doc2 = Document.objects.create(title="doc2", checksum="B", content="test test2")
|
||||
doc3 = Document.objects.create(title="doc3", checksum="C", content="test2")
|
||||
@@ -21,10 +22,12 @@ class TestAutoComplete(DirectoriesMixin, TestCase):
|
||||
ix = index.open_index()
|
||||
|
||||
self.assertListEqual(
|
||||
index.autocomplete(ix, "tes"), [b"test3", b"test", b"test2"]
|
||||
index.autocomplete(ix, "tes"),
|
||||
[b"test3", b"test", b"test2"],
|
||||
)
|
||||
self.assertListEqual(
|
||||
index.autocomplete(ix, "tes", limit=3), [b"test3", b"test", b"test2"]
|
||||
index.autocomplete(ix, "tes", limit=3),
|
||||
[b"test3", b"test", b"test2"],
|
||||
)
|
||||
self.assertListEqual(index.autocomplete(ix, "tes", limit=1), [b"test3"])
|
||||
self.assertListEqual(index.autocomplete(ix, "tes", limit=0), [])
|
||||
|
Reference in New Issue
Block a user