Testing for whoosh support for multi-object query vars

This commit is contained in:
shamoon 2023-04-27 08:47:36 -07:00
parent 448dcbab46
commit 1a1cf49c67

View File

@ -955,8 +955,32 @@ class TestDocumentApi(DirectoriesMixin, DocumentConsumeDelayMixin, APITestCase):
[d1.id, d2.id, d5.id, d7.id], [d1.id, d2.id, d5.id, d7.id],
) )
self.assertCountEqual(search_query("&correspondent__id=" + str(c.id)), [d1.id]) self.assertCountEqual(search_query("&correspondent__id=" + str(c.id)), [d1.id])
self.assertCountEqual(
search_query("&correspondent__id__in=" + str(c.id)),
[d1.id],
)
self.assertCountEqual(
search_query("&correspondent__id__none=" + str(c.id)),
[d2.id, d3.id, d4.id, d5.id, d7.id],
)
self.assertCountEqual(search_query("&document_type__id=" + str(dt.id)), [d2.id]) self.assertCountEqual(search_query("&document_type__id=" + str(dt.id)), [d2.id])
self.assertCountEqual(
search_query("&document_type__id__in=" + str(dt.id)),
[d2.id],
)
self.assertCountEqual(
search_query("&document_type__id__none=" + str(dt.id)),
[d1.id, d3.id, d4.id, d5.id, d7.id],
)
self.assertCountEqual(search_query("&storage_path__id=" + str(sp.id)), [d7.id]) self.assertCountEqual(search_query("&storage_path__id=" + str(sp.id)), [d7.id])
self.assertCountEqual(
search_query("&storage_path__id__in=" + str(sp.id)),
[d7.id],
)
self.assertCountEqual(
search_query("&storage_path__id__none=" + str(sp.id)),
[d1.id, d2.id, d3.id, d4.id, d5.id],
)
self.assertCountEqual( self.assertCountEqual(
search_query("&storage_path__isnull"), search_query("&storage_path__isnull"),