def test_create_post(entity):
    """Test creating a post (belonging to the current entity)"""
    data = {
        'type': 'https://tent.io/types/post/status/v0.1.0',
        'content': {
            'text': "^SoftlySplinter: Hello World"
        },
        'mentions': [
            {'entity': 'http://softly.example.com'}
        ],
    }
    response = SPOST('posts.posts', data=data)
    assert 'text' in response.json()['content']

    # Fetch the post using the database
    post_id = response.json()['id']
    created_post = entity.posts.get(id=post_id)
    assert created_post.schema == data['type']
    assert created_post.latest.content == data['content']

    # Fetch the post using the API
    response = GET('posts.posts', secure=True)
    assert 'text' in response.json()[0]['content']
dataset/ETHPy150Open pytent/pytentd/tentd/tests/blueprints/test_posts.py/test_create_post/original