Thubrecht/daphne #815

Merged
thubrecht merged 39 commits from thubrecht/daphne into master 2024-07-30 18:40:56 +02:00
2 changed files with 7 additions and 1 deletions
Showing only changes of commit 7d8926e459 - Show all commits

View file

@ -283,8 +283,10 @@ class OpenKfetScenarioTest(TestCase):
cls.r_c.login(username="team", password="team") cls.r_c.login(username="team", password="team")
def setUp(self): def setUp(self):
# Create a channel to listen to KPsul's messages # Create channels to listen to messages
channel_layer = get_channel_layer() channel_layer = get_channel_layer()
async_to_sync(channel_layer.flush)()
self.channel = async_to_sync(channel_layer.new_channel)() self.channel = async_to_sync(channel_layer.new_channel)()
self.team_channel = async_to_sync(channel_layer.new_channel)() self.team_channel = async_to_sync(channel_layer.new_channel)()

View file

@ -1812,6 +1812,7 @@ class KPsulPerformOperationsViewTests(ViewTestCaseMixin, TestCase):
# Create a channel to listen to KPsul's messages # Create a channel to listen to KPsul's messages
channel_layer = get_channel_layer() channel_layer = get_channel_layer()
async_to_sync(channel_layer.flush)()
self.channel = async_to_sync(channel_layer.new_channel)() self.channel = async_to_sync(channel_layer.new_channel)()
async_to_sync(channel_layer.group_add)("kfet.kpsul", self.channel) async_to_sync(channel_layer.group_add)("kfet.kpsul", self.channel)
@ -3240,6 +3241,9 @@ class KPsulCancelOperationsViewTests(ViewTestCaseMixin, TestCase):
# Create a channel to listen to KPsul's messages # Create a channel to listen to KPsul's messages
channel_layer = get_channel_layer() channel_layer = get_channel_layer()
# Flush old messages
async_to_sync(channel_layer.flush)()
self.channel = async_to_sync(channel_layer.new_channel)() self.channel = async_to_sync(channel_layer.new_channel)()
async_to_sync(channel_layer.group_add)("kfet.kpsul", self.channel) async_to_sync(channel_layer.group_add)("kfet.kpsul", self.channel)