From a5d56a0eb4fc16b25168567c61c2b4d8f6f948ec Mon Sep 17 00:00:00 2001 From: Gust Date: Wed, 24 Jun 2015 10:48:26 -0300 Subject: [PATCH] Fix test to ignore list order --- colab/search/tests.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/colab/search/tests.py b/colab/search/tests.py index 6b054d6..124b51f 100644 --- a/colab/search/tests.py +++ b/colab/search/tests.py @@ -9,7 +9,7 @@ class SearchViewTest(TestCase): fixtures = ['test_data.json'] def setUp(self): - call_command('update_index', interactive=False, verbosity=0) + call_command('rebuild_index', interactive=False, verbosity=0) self.client = Client() def tearDown(self): @@ -21,12 +21,12 @@ class SearchViewTest(TestCase): self.assertEqual(3, len(thread_list)) - self.assertIn('This is a repply to Thread 1 on list A', - thread_list[0].description) - self.assertIn('This is a repply to Thread 1 on list C', - thread_list[1].description) - self.assertIn('This is a repply to Thread 1 on list B', - thread_list[2].description) + condition = any('This is a repply to Thread 1 on list A' in t.description for t in thread_list) + self.assertTrue(condition) + condition = any('This is a repply to Thread 1 on list B' in t.description for t in thread_list) + self.assertTrue(condition) + condition = any('This is a repply to Thread 1 on list C' in t.description for t in thread_list) + self.assertTrue(condition) def test_search_account_by_firstName(self): request = self.client.get('/search/?q=Chuck') -- libgit2 0.21.2