def test_request_to_xml(self): entity = DiasporaRequest(handle="*****@*****.**", target_handle="*****@*****.**", relationship="following") result = entity.to_xml() assert result.tag == "request" converted = b"<request><sender_handle>[email protected]</sender_handle>" \ b"<recipient_handle>[email protected]</recipient_handle></request>" assert etree.tostring(result) == converted
def test_already_fine_entities_are_returned_as_is(self): entity = DiasporaPost() assert get_outbound_entity(entity) == entity entity = DiasporaLike() assert get_outbound_entity(entity) == entity entity = DiasporaComment() assert get_outbound_entity(entity) == entity entity = DiasporaRequest() assert get_outbound_entity(entity) == entity entity = DiasporaProfile() assert get_outbound_entity(entity) == entity
def diasporarequest(): return DiasporaRequest(handle="*****@*****.**", target_handle="*****@*****.**", relationship="following")