mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-27 03:51:08 +00:00
Adds test for stop word null state
This commit is contained in:
parent
68fc5f2b5a
commit
e168720420
1 changed files with 8 additions and 0 deletions
|
@ -64,3 +64,11 @@ class PostgresTriggers(TestCase):
|
||||||
book.authors.remove(author)
|
book.authors.remove(author)
|
||||||
book.refresh_from_db()
|
book.refresh_from_db()
|
||||||
self.assertEqual(book.search_vector, "'goodby':3A 'long':2A")
|
self.assertEqual(book.search_vector, "'goodby':3A 'long':2A")
|
||||||
|
|
||||||
|
def test_search_vector_stop_word_fallback(self):
|
||||||
|
"""use a fallback when removing stop words leads to an empty vector"""
|
||||||
|
book = models.Edition.objects.create(
|
||||||
|
title="there there",
|
||||||
|
)
|
||||||
|
book.refresh_from_db()
|
||||||
|
self.assertEqual(book.search_vector, "'there':1A,2A")
|
||||||
|
|
Loading…
Reference in a new issue