File tree 2 files changed +8
-22
lines changed
2 files changed +8
-22
lines changed Original file line number Diff line number Diff line change @@ -516,19 +516,12 @@ async def test_update_empty_field(async_client):
516
516
await Tags ._index .delete (ignore_unavailable = True )
517
517
await Tags .init ()
518
518
d = Tags (id = "123" , tags = ["a" , "b" ])
519
- await d .save (wait_for_active_shards = 1 )
520
- await d .update (tags = [])
519
+ await d .save (refresh = True )
520
+ await d .update (tags = [], refresh = True )
521
521
assert d .tags == []
522
522
523
- while True :
524
- try :
525
- r = await Tags .search ().execute ()
526
- d = r .hits [0 ]
527
- except IndexError :
528
- continue
529
- else :
530
- break
531
- assert d .tags == []
523
+ r = await Tags .search ().execute ()
524
+ assert r .hits [0 ].tags == []
532
525
533
526
534
527
@pytest .mark .asyncio
Original file line number Diff line number Diff line change @@ -510,19 +510,12 @@ def test_update_empty_field(client):
510
510
Tags ._index .delete (ignore_unavailable = True )
511
511
Tags .init ()
512
512
d = Tags (id = "123" , tags = ["a" , "b" ])
513
- d .save (wait_for_active_shards = 1 )
514
- d .update (tags = [])
513
+ d .save (refresh = True )
514
+ d .update (tags = [], refresh = True )
515
515
assert d .tags == []
516
516
517
- while True :
518
- try :
519
- r = Tags .search ().execute ()
520
- d = r .hits [0 ]
521
- except IndexError :
522
- continue
523
- else :
524
- break
525
- assert d .tags == []
517
+ r = Tags .search ().execute ()
518
+ assert r .hits [0 ].tags == []
526
519
527
520
528
521
@pytest .mark .sync
You can’t perform that action at this time.
0 commit comments