Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Federighi committed Oct 16, 2015
1 parent 59d23a7 commit bc12b6e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ def test_blog_post_is_indexed_using_prepare(self):
index.index_queryset(DEFAULT_ALIAS) # initialises index._backend_alias
indexed = index.prepare(post)
print(indexed)
self.assertEqual('First post', indexed['title'])
self.assertEqual('This is the description', indexed['description'])
self.assertEqual(post.get_title(), indexed['title'])
self.assertEqual(post.get_description(), indexed['description'])
self.assertEqual('First post first line This is the description category 1', indexed['text'])
self.assertEqual('/en/page-two/2015/10/15/first-post/', indexed['url'])
self.assertEqual(post.get_absolute_url(), indexed['url'])
self.assertEqual(post.date_published.strftime("%Y-%m-%d %H:%M:%S"), indexed['pub_date'])

def test_blog_post_is_indexed_using_update_object(self):
"""This tests the indexing path way used by the RealTimeSignalProcessor"""
Expand All @@ -32,8 +33,10 @@ def test_blog_post_is_indexed_using_update_object(self):
index = self.get_post_index()
index.update_object(post, using=DEFAULT_ALIAS)
indexed = index.prepared_data
self.assertEqual('First post', indexed['title'])
self.assertEqual('This is the description', indexed['description'])
print(indexed)
self.assertEqual(post.get_title(), indexed['title'])
self.assertEqual(post.get_description(), indexed['description'])
self.assertEqual('First post first line This is the description category 1', indexed['text'])
self.assertEqual('/en/page-two/2015/10/15/first-post/', indexed['url'])
self.assertEqual(post.get_absolute_url(), indexed['url'])
self.assertEqual(post.date_published.strftime("%Y-%m-%d %H:%M:%S"), indexed['pub_date'])

0 comments on commit bc12b6e

Please sign in to comment.