def test_pinning_non_owner(create_input): channel_invite_v2(create_input[0][0]['token'], create_input[1][0], create_input[0][1]['auth_user_id']) assert message_pin_v1(create_input[0][1]['token'], create_input[3][0]).status_code == ACCESS_ERROR assert message_pin_v1(create_input[0][2]['token'], create_input[4][0]).status_code == ACCESS_ERROR
def test_unpinning_non_member(create_input): message_pin_v1(create_input[0][0]['token'], create_input[3][0]) message_pin_v1(create_input[0][0]['token'], create_input[4][0]) assert message_unpin_v1(create_input[0][4]['token'], create_input[3][0]).status_code == ACCESS_ERROR assert message_unpin_v1(create_input[0][4]['token'], create_input[4][0]).status_code == ACCESS_ERROR
def test_pinning_invalid_message(create_input): message_remove_v1(create_input[0][0]['token'], create_input[3][0]) message_remove_v1(create_input[0][0]['token'], create_input[4][0]) assert message_pin_v1(create_input[0][0]['token'], create_input[3][0]).status_code == INPUT_ERROR assert message_pin_v1(create_input[0][0]['token'], create_input[4][0]).status_code == INPUT_ERROR
def test_pinning_already_pinned(create_input): message_pin_v1(create_input[0][0]['token'], create_input[3][0]) message_pin_v1(create_input[0][0]['token'], create_input[4][0]) assert message_pin_v1(create_input[0][0]['token'], create_input[3][0]).status_code == INPUT_ERROR assert message_pin_v1(create_input[0][0]['token'], create_input[4][0]).status_code == INPUT_ERROR
def test_multiple_dm_unpin(create_input): message_pin_v1(create_input[0][0]['token'], create_input[4][0]) message_pin_v1(create_input[0][0]['token'], create_input[4][1]) message_pin_v1(create_input[0][0]['token'], create_input[4][2]) message_pin_v1(create_input[0][0]['token'], create_input[4][4]) message_unpin_v1(create_input[0][0]['token'], create_input[4][1]) message_unpin_v1(create_input[0][0]['token'], create_input[4][2]) assert dm_messages_v1(create_input[0][0]['token'], create_input[2][0], 0).json()['messages'][4]['is_pinned'] == True assert dm_messages_v1(create_input[0][0]['token'], create_input[2][0], 0).json()['messages'][3]['is_pinned'] == False assert dm_messages_v1(create_input[0][0]['token'], create_input[2][0], 0).json()['messages'][2]['is_pinned'] == False assert dm_messages_v1(create_input[0][0]['token'], create_input[2][0], 0).json()['messages'][1]['is_pinned'] == False assert dm_messages_v1(create_input[0][0]['token'], create_input[2][0], 0).json()['messages'][0]['is_pinned'] == True
def test_simple_channel_unpin(create_input): message_pin_v1(create_input[0][0]['token'], create_input[3][0]) message_unpin_v1(create_input[0][0]['token'], create_input[3][0]) assert channel_messages_v2(create_input[0][0]['token'], create_input[1][0], 0).json()['messages'][4]['is_pinned'] == False