def _format_data(test_data):
    """Format data string to store in test case."""
    result = '[\n'
    for data_set in test_data:
        result += '    {\n'
        for key, value in data_set.items():
            if not value:
                value = "''"
            result += '        \'{}\': {},\n'.format(key, value)
        result += '    },\n'
    result += ']\n\n'
    return result