diff --git a/deltachat-rpc-client/src/deltachat_rpc_client/pytestplugin.py b/deltachat-rpc-client/src/deltachat_rpc_client/pytestplugin.py index 3b276cae8..435e21d18 100644 --- a/deltachat-rpc-client/src/deltachat_rpc_client/pytestplugin.py +++ b/deltachat-rpc-client/src/deltachat_rpc_client/pytestplugin.py @@ -59,6 +59,16 @@ class ACFactory: def get_online_accounts(self, num: int) -> List[Account]: return [self.get_online_account() for _ in range(num)] + def resetup_account(self, ac: Account) -> Account: + """Resetup account from scratch, losing the encryption key.""" + ac.stop_io() + ac_clone = self.get_unconfigured_account() + for i in ["addr", "mail_pw"]: + ac_clone.set_config(i, ac.get_config(i)) + ac.remove() + ac_clone.configure() + return ac_clone + def send_message( self, to_account: Account, diff --git a/deltachat-rpc-client/tests/test_something.py b/deltachat-rpc-client/tests/test_something.py index 1100d1c93..7fe8c462e 100644 --- a/deltachat-rpc-client/tests/test_something.py +++ b/deltachat-rpc-client/tests/test_something.py @@ -419,14 +419,7 @@ def test_verified_group_recovery(acfactory, rpc) -> None: break logging.info("ac2 logs in on a new device") - ac2.stop_io() - ac2_clone = acfactory.get_unconfigured_account() - for i in ["addr", "mail_pw"]: - ac2_clone.set_config(i, ac2.get_config(i)) - rpc.remove_account(ac2.id) - ac2_clone.configure() - ac2 = ac2_clone - del ac2_clone + ac2 = acfactory.resetup_account(ac2) logging.info("ac2 reverifies with ac3") qr_code, _svg = ac3.get_qr_code()