1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-04 02:09:17 +02:00

move towards message creation API, refactor constructors for messages

This commit is contained in:
holger krekel 2018-10-07 15:07:14 +02:00
parent e45acb17a3
commit aaf37821c4
4 changed files with 55 additions and 10 deletions

View file

@ -92,6 +92,15 @@ class TestOfflineAccount:
with pytest.raises(ValueError):
chat.send_text("msg1")
def test_create_message(self, acfactory):
ac1 = acfactory.get_configured_offline_account()
message = ac1.create_message("text")
assert message.id == 0
assert message._dc_msg is message._dc_msg
message.set_text("hello")
assert message.text == "hello"
assert not message.is_persistent()
def test_message(self, acfactory):
ac1 = acfactory.get_configured_offline_account()
contact1 = ac1.create_contact("some1@hello.com", name="some1")