fix error in ws_connect

This commit is contained in:
Iacopo Spalletti 2017-12-31 13:45:05 +01:00
parent 51fd5a58d7
commit 117952a1d7
No known key found for this signature in database
GPG key ID: BDCBC2EB289F60C6
2 changed files with 7 additions and 0 deletions

View file

@ -27,6 +27,7 @@ def liveblog_connect(message, apphook, lang, post):
}) })
return return
Group(post.liveblog_group).add(message.reply_channel) Group(post.liveblog_group).add(message.reply_channel)
message.reply_channel.send({"accept": True})
def liveblog_disconnect(message, apphook, lang, post): def liveblog_disconnect(message, apphook, lang, post):

View file

@ -38,6 +38,8 @@ try:
Channel('setup').send({'connect': 1, 'reply_channel': 'reply'}) Channel('setup').send({'connect': 1, 'reply_channel': 'reply'})
message = self.get_next_message('setup', require=True) message = self.get_next_message('setup', require=True)
liveblog_connect(message, self.app_config_1.namespace, 'en', post.slug) liveblog_connect(message, self.app_config_1.namespace, 'en', post.slug)
result = self.get_next_message(message.reply_channel.name, require=True)
self.assertTrue(result['accept'])
plugin = add_plugin( plugin = add_plugin(
post.liveblog, 'LiveblogPlugin', language='en', body='live text', publish=True post.liveblog, 'LiveblogPlugin', language='en', body='live text', publish=True
@ -80,6 +82,8 @@ try:
Channel('setup').send({'connect': 1, 'reply_channel': 'reply'}) Channel('setup').send({'connect': 1, 'reply_channel': 'reply'})
message = self.get_next_message('setup', require=True) message = self.get_next_message('setup', require=True)
liveblog_connect(message, self.app_config_1.namespace, 'en', post.slug) liveblog_connect(message, self.app_config_1.namespace, 'en', post.slug)
result = self.get_next_message(message.reply_channel.name, require=True)
self.assertTrue(result['accept'])
plugin = add_plugin( plugin = add_plugin(
post.liveblog, 'LiveblogPlugin', language='en', body='live text', publish=False post.liveblog, 'LiveblogPlugin', language='en', body='live text', publish=False
@ -114,6 +118,8 @@ try:
Channel('setup').send({'connect': 1, 'reply_channel': 'reply'}) Channel('setup').send({'connect': 1, 'reply_channel': 'reply'})
message = self.get_next_message('setup', require=True) message = self.get_next_message('setup', require=True)
liveblog_connect(message, self.app_config_1.namespace, 'en', post.slug) liveblog_connect(message, self.app_config_1.namespace, 'en', post.slug)
result = self.get_next_message(message.reply_channel.name, require=True)
self.assertTrue(result['accept'])
plugin = add_plugin( plugin = add_plugin(
post.liveblog, 'LiveblogPlugin', language='en', body='live text', publish=True post.liveblog, 'LiveblogPlugin', language='en', body='live text', publish=True