Commit a5d56a0eb4fc16b25168567c61c2b4d8f6f948ec
1 parent
d47aeafe
Exists in
workin_whoosh_temp
Fix test to ignore list order
Signed-off-by: Gustavo Jaruga <darksshades@gmail.com> Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com>
Showing
1 changed file
with
7 additions
and
7 deletions
Show diff stats
colab/search/tests.py
... | ... | @@ -9,7 +9,7 @@ class SearchViewTest(TestCase): |
9 | 9 | fixtures = ['test_data.json'] |
10 | 10 | |
11 | 11 | def setUp(self): |
12 | - call_command('update_index', interactive=False, verbosity=0) | |
12 | + call_command('rebuild_index', interactive=False, verbosity=0) | |
13 | 13 | self.client = Client() |
14 | 14 | |
15 | 15 | def tearDown(self): |
... | ... | @@ -21,12 +21,12 @@ class SearchViewTest(TestCase): |
21 | 21 | |
22 | 22 | self.assertEqual(3, len(thread_list)) |
23 | 23 | |
24 | - self.assertIn('This is a repply to Thread 1 on list A', | |
25 | - thread_list[0].description) | |
26 | - self.assertIn('This is a repply to Thread 1 on list C', | |
27 | - thread_list[1].description) | |
28 | - self.assertIn('This is a repply to Thread 1 on list B', | |
29 | - thread_list[2].description) | |
24 | + condition = any('This is a repply to Thread 1 on list A' in t.description for t in thread_list) | |
25 | + self.assertTrue(condition) | |
26 | + condition = any('This is a repply to Thread 1 on list B' in t.description for t in thread_list) | |
27 | + self.assertTrue(condition) | |
28 | + condition = any('This is a repply to Thread 1 on list C' in t.description for t in thread_list) | |
29 | + self.assertTrue(condition) | |
30 | 30 | |
31 | 31 | def test_search_account_by_firstName(self): |
32 | 32 | request = self.client.get('/search/?q=Chuck') | ... | ... |