Ejemplo n.º 1
0
def test_search_4():
    owner_token, owner_id, u_token, u_id, channel_id, channel_id2 = setup_users()
    message1, message2, message3, message4, message5 = setup_messages()
    message_time = math.floor(datetime.now().replace().timestamp())
    assert (search(owner_token, "no match") == {
        'messages': []
    })
Ejemplo n.º 2
0
def test_search_3():
    owner_token, owner_id, u_token, u_id, channel_id, channel_id2 = setup_users()
    message1, message2, message3, message4, message5 = setup_messages()
    message_time = math.floor(datetime.now().replace().timestamp())
    message_id1 = message1['message_id']
    message_id2 = message2['message_id']
    assert (search(owner_token, "message1") == {
        'messages': [
            {
                'message_id': message_id1,
                'u_id': owner_id,
                'message': "message1",
                'time_created': message_time,
                'is_unread': True,
                'reacts': [],
                'is_pinned': False,
            },
            {
                'message_id': message_id2,
                'u_id': owner_id,
                'message': "message12",
                'time_created': message_time,
                'is_unread': True,
                'reacts': [],
                'is_pinned': False,
            }
        ]
    })