diff --git a/deltachat-rpc-client/tests/test_securejoin.py b/deltachat-rpc-client/tests/test_securejoin.py index 1accec207c..54799adf13 100644 --- a/deltachat-rpc-client/tests/test_securejoin.py +++ b/deltachat-rpc-client/tests/test_securejoin.py @@ -150,7 +150,7 @@ def wait_for_broadcast_messages(ac): assert snapshot1.chat_id == chat.id assert snapshot2.chat_id == chat.id - def check_account(ac, contact, inviter_side, please_wait_info_msg=False, resent_msg=False): + def check_account(ac, contact, inviter_side, please_wait_info_msg=False): # Check that the chat partner is verified. contact_snapshot = contact.get_snapshot() assert contact_snapshot.is_verified @@ -172,8 +172,11 @@ def check_account(ac, contact, inviter_side, please_wait_info_msg=False, resent_ assert member_added_msg.text == f"Member {contact_snapshot.display_name} added." assert member_added_msg.info_contact_id == contact_snapshot.id else: - member_added_msg = chat_msgs.pop(1 if resent_msg else 0).get_snapshot() - assert member_added_msg.text == "You joined the channel." + if chat_msgs[0].get_snapshot().text == "You joined the channel.": + member_added_msg = chat_msgs.pop(0).get_snapshot() + else: + member_added_msg = chat_msgs.pop(1).get_snapshot() + assert member_added_msg.text == "You joined the channel." assert member_added_msg.is_info hello_msg = chat_msgs.pop(0).get_snapshot() @@ -243,7 +246,7 @@ def check_account(ac, contact, inviter_side, please_wait_info_msg=False, resent_ snapshot = fiona.wait_for_incoming_msg().get_snapshot() assert snapshot.text == "Hello everyone!" - check_account(fiona, fiona.create_contact(alice), inviter_side=False, please_wait_info_msg=True, resent_msg=True) + check_account(fiona, fiona.create_contact(alice), inviter_side=False, please_wait_info_msg=True) # For Bob, the channel must not have changed: check_account(bob, bob.create_contact(alice), inviter_side=False, please_wait_info_msg=True)