def _set_token(message): text_split = message.text.split() if len(text_split) != 2: return token = text_split[1] chat = Chat.set_token(message.chat.id, token) send_message(chat, 'New token {}'.format(chat.token))
def test_set_token(random_token): Chat.set_token(123, random_token) chat = Chat.get_chat(123) assert chat.token == random_token