Skip to content

Commit f7e1282

Browse files
committed
fix: commands and index tests
1 parent 999f115 commit f7e1282

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

runtests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def main():
1212
os.environ["DJANGO_SETTINGS_MODULE"] = "tests.settings"
1313
django.setup()
1414
TestRunner = get_runner(settings)
15-
test_runner = TestRunner(failfase=True)
15+
test_runner = TestRunner(failfast=True)
1616
# kept here to run a single test
1717
# failures = test_runner.run_tests(
1818
# [

tests/test_commands.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,14 @@ def tearDownClass(cls):
2121

2222
def setUp(self):
2323
# Create some records
24-
User(name="James Bond", username="jb", followers_count=0)
25-
User(name="Captain America", username="captain", followers_count=0)
26-
User(
27-
name="John Snow",
28-
username="john_snow",
29-
_lat=120.2,
30-
_lng=42.1,
31-
followers_count=0,
32-
)
33-
User(name="Steve Jobs", username="genius", followers_count=331213)
24+
u = User(name="James Bond", username="jb", followers_count=0, following_count=0, _lat=0, _lng=0)
25+
u.save()
26+
u = User(name="Captain America", username="captain", followers_count=0, following_count=0, _lat=0, _lng=0)
27+
u.save()
28+
u = User(name="John Snow", username="john_snow", _lat=120.2, _lng=42.1, followers_count=0, following_count=0)
29+
u.save()
30+
u = User(name="Steve Jobs", username="genius", followers_count=331213, following_count=0, _lat=0, _lng=0)
31+
u.save()
3432

3533
self.out = StringIO()
3634

tests/test_index.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,8 @@ class WebsiteIndex(AlgoliaIndex):
264264
if self.index.index_name is None:
265265
return
266266

267-
self.client.save_rule_with_http_info(
268-
self.index.index_name, rule["objectID"], rule
269-
)
267+
_resp = self.client.save_rule(self.index.index_name, rule["objectID"], rule)
268+
self.client.wait_for_task(self.index.index_name, _resp.task_id)
270269

271270
# When reindexing with no settings on the instance
272271
self.index = WebsiteIndex(Website, self.client, settings.ALGOLIA)

0 commit comments

Comments
 (0)