4 from mygpo
.podcasts
.models
import Podcast
5 from django
.contrib
.postgres
.search
import SearchVector
7 from .index
import search_podcasts
8 from .tasks
import update_search_index
11 class SearchTests(unittest
.TestCase
):
12 """ Tests podcast search """
14 def test_search_podcast(self
):
15 """ Search if a podcast is found in the search results """
20 title
= 'Awesome Podcast',
21 description
= 'An amazing podcast on many topics',
25 # explicitly trigger a search index update
28 # search for the podcast
29 results
= search_podcasts('awesome')
30 self
.assertEqual(results
[0].id, podcast
.id)