Skip to content

Commit

Permalink
Update test to match new models
Browse files Browse the repository at this point in the history
  • Loading branch information
gunthercox committed Apr 29, 2020
1 parent 2dd74ac commit 3f97001
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests_django/test_chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,18 +292,18 @@ def test_search_text_contains_results_after_training(self):
string when filtering using the search_text parameter.
"""
self.chatbot.storage.create_many([
Statement('Example A for search.'),
Statement('Example 1 for search.'),
Statement('Another example.'),
Statement('Example B for search.'),
Statement('Example 2 for search.'),
Statement(text='Another statement.'),
])

results = list(self.chatbot.storage.filter(
search_text_contains=self.chatbot.storage.tagger.get_text_index_string(
'Example A for search.'
'Example 1 for search.'
)
))

self.assertEqual(len(results), 2, msg=[r.text for r in results])
self.assertEqual('Example A for search.', results[0].text)
self.assertEqual('Example B for search.', results[1].text)
self.assertEqual('Example 1 for search.', results[0].text)
self.assertEqual('Example 2 for search.', results[1].text)

0 comments on commit 3f97001

Please sign in to comment.