def test_save_msg(msg='hahah', tag='test tag', talker='admin', expiry=None, time=None, force_create=True): """test save a message""" interface = DataTransfer(Database(PATH)) msg = MsgWithTag(msg, tag, talker, expiry, time) interface.save_msg(msg, force_create=force_create) assert interface.get_msg_by_id(1) is not None
def test_del_msg_by_id(): """test delete a message""" interface = DataTransfer(Database(PATH)) interface.del_msg_by_id(1) assert interface.get_msg_by_id(1) is None