1
1
# coding=utf-8
2
- import time
3
2
from django .conf import settings
4
3
from django .test import TestCase
5
4
6
- import unittest
7
5
8
6
from algoliasearch_django import AlgoliaIndex
9
7
from algoliasearch_django import algolia_engine
@@ -153,9 +151,6 @@ class WebsiteIndex(AlgoliaIndex):
153
151
self .index = WebsiteIndex (Website , self .client , settings .ALGOLIA )
154
152
self .index .reindex_all ()
155
153
156
- @unittest .skip (
157
- reason = "FIXME: it's a known issue that reindex all might not work properly"
158
- )
159
154
def test_reindex_no_settings (self ):
160
155
self .maxDiff = None
161
156
@@ -179,9 +174,6 @@ class WebsiteIndex(AlgoliaIndex):
179
174
"An index whose model has no settings should keep its settings after reindex" ,
180
175
)
181
176
182
- @unittest .skip (
183
- reason = "FIXME: it's a known issue that reindex all might not work properly"
184
- )
185
177
def test_reindex_with_settings (self ):
186
178
import uuid
187
179
@@ -232,7 +224,7 @@ class WebsiteIndex(AlgoliaIndex):
232
224
self .index = WebsiteIndex (Website , self .client , settings .ALGOLIA )
233
225
234
226
# Given some existing query rules on the index
235
- # index.__index .save_rule() # TODO: Check query rules are kept
227
+ self . index .__client .save_rule ()
236
228
237
229
# Given some existing settings on the index
238
230
existing_settings = self .apply_some_settings (self .index )
@@ -246,9 +238,6 @@ class WebsiteIndex(AlgoliaIndex):
246
238
former_settings ["hitsPerPage" ] = 15
247
239
self .assertDictEqual (self .index .get_settings (), former_settings )
248
240
249
- @unittest .skip (
250
- reason = "FIXME: it's a known issue that reindex all might not work properly"
251
- )
252
241
def test_reindex_with_rules (self ):
253
242
# Given an existing index defined with settings
254
243
class WebsiteIndex (AlgoliaIndex ):
@@ -283,9 +272,6 @@ def remove_metadata(rule):
283
272
self .assertEqual (len (rules ), 1 , "There should only be one rule" )
284
273
self .assertIn (rule , rules , "The existing rule should be kept over reindex" )
285
274
286
- @unittest .skip (
287
- reason = "FIXME: it's a known issue that reindex all might not work properly"
288
- )
289
275
def test_reindex_with_synonyms (self ):
290
276
# Given an existing index defined with settings
291
277
class WebsiteIndex (AlgoliaIndex ):
@@ -332,7 +318,6 @@ def apply_some_settings(self, index):
332
318
index .settings ["hitsPerPage" ] = 42
333
319
index .reindex_all ()
334
320
index .settings ["hitsPerPage" ] = old_hpp
335
- time .sleep (10 ) # FIXME: Refactor reindex_all to return taskID
336
321
index_settings = index .get_settings ()
337
322
# Expect the instance's settings to be applied at reindex
338
323
self .assertEqual (
0 commit comments