

def test_POST_to_secret_endpoint_should_call_publish():
    reload(draftin_a_flask)
    test_client = draftin_a_flask.app.test_client()
    draftin_a_flask.publish = MagicMock()
    data = {
        'id': 12345,
        'name': 'Some document',
        'content': 'Some markdown',
        'content_html': 'Some html',
        'created_at': '2013-05-23T14:11:54-05:00',
        'updated_at': '2013-05-23T14:11:58-05:00',
    }
    rv = test_client.post(draftin_a_flask.app.secret_key, data={
        'payload': json.dumps(data),
    })
    expected = [call.publish(data['name'], data['content'])]
    assert (draftin_a_flask.publish.mock_calls == data)

dataset/ETHPy150Open waynew/draftin-a-flask/tests/test_draftin_a_flask.py test_POST_to_secret_endpoint_should_call_publish/VarMisuse@124/224 `expected`->`data`