mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-11-01 05:44:30 +01:00
Test sur les tirages au sort réparé
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
# Copyright (C) 2023 by Animath
|
# Copyright (C) 2023 by Animath
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
import asyncio
|
|
||||||
from random import shuffle
|
from random import shuffle
|
||||||
|
|
||||||
from asgiref.sync import sync_to_async
|
from asgiref.sync import sync_to_async
|
||||||
@@ -712,15 +711,12 @@ class TestDraw(TestCase):
|
|||||||
{'tid': tid, 'type': 'export_visibility', 'visible': False})
|
{'tid': tid, 'type': 'export_visibility', 'visible': False})
|
||||||
|
|
||||||
# Cancel all steps and reset all
|
# Cancel all steps and reset all
|
||||||
for i in range(1000):
|
for i in range(150):
|
||||||
await communicator.send_json_to({'tid': tid, 'type': 'cancel'})
|
await communicator.send_json_to({'tid': tid, 'type': 'cancel'})
|
||||||
|
|
||||||
# Purge receive queue
|
# Purge receive queue
|
||||||
while True:
|
while (await communicator.receive_json_from())['type'] != "abort":
|
||||||
try:
|
pass
|
||||||
await communicator.receive_json_from()
|
|
||||||
except asyncio.TimeoutError:
|
|
||||||
break
|
|
||||||
|
|
||||||
if await Draw.objects.filter(tournament_id=tid).aexists():
|
if await Draw.objects.filter(tournament_id=tid).aexists():
|
||||||
print((await Draw.objects.filter(tournament_id=tid).aexists()))
|
print((await Draw.objects.filter(tournament_id=tid).aexists()))
|
||||||
|
|||||||
Reference in New Issue
Block a user