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

add sending timestamp

This commit is contained in:
holger krekel 2018-09-25 12:53:36 +02:00
parent 5fcbc11bf3
commit 68900edfbc
2 changed files with 32 additions and 1 deletions

View file

@ -1,6 +1,7 @@
from __future__ import print_function
import pytest
from deltachat.capi import lib
from datetime import datetime, timedelta
from conftest import wait_configuration_progress, wait_successful_IMAP_SMTP_connection
@ -96,6 +97,18 @@ class TestOfflineAccount:
assert not msg_state.is_out_delivered()
assert not msg_state.is_out_mdn_received()
def test_chat_message_distinctions(self, acfactory):
ac1 = acfactory.get_configured_offline_account()
contact1 = ac1.create_contact("some1@hello.com", name="some1")
chat = ac1.create_chat_by_contact(contact1)
past1s = datetime.now() - timedelta(seconds=1)
msg = chat.send_text_message("msg1")
ts = msg.time_sent
assert ts.strftime("Y")
assert past1s < ts
contact = msg.get_sender_contact()
assert contact == ac1.get_self_contact()
def test_basic_configure_ok_addr_setting_forbidden(self, acfactory):
ac1 = acfactory.get_configured_offline_account()
assert ac1.get_config("mail_pw")