Skip to content

Commit a2416ed

Browse files
committed
test: mvbox_move is disabled when first transport is set up
1 parent b14e9ec commit a2416ed

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

deltachat-rpc-client/tests/test_multitransport.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,27 @@ def test_change_address(acfactory) -> None:
9494
assert sender_addr1 != sender_addr2
9595
assert sender_addr1 == old_alice_addr
9696
assert sender_addr2 == new_alice_addr
97+
98+
99+
@pytest.mark.parametrize("is_chatmail", ["0", "1"])
100+
def test_mvbox_move_first_transport(acfactory, is_chatmail) -> None:
101+
"""Test that mvbox_move is disabled by default even for non-chatmail accounts.
102+
Disabling mvbox_move is required to be able to setup a second transport.
103+
"""
104+
account = acfactory.get_unconfigured_account()
105+
106+
account.set_config("fix_is_chatmail", "1")
107+
account.set_config("is_chatmail", is_chatmail)
108+
109+
# The default value when the setting is unset is "1".
110+
# This is not changed for compatibility with old databases
111+
# imported from backups.
112+
assert account.get_config("mvbox_move") == "1"
113+
114+
qr = acfactory.get_account_qr()
115+
account.add_transport_from_qr(qr)
116+
117+
# Once the first transport is set up,
118+
# mvbox_move is disabled.
119+
assert account.get_config("mvbox_move") == "0"
120+
assert account.get_config("is_chatmail") == is_chatmail

0 commit comments

Comments
 (0)