'Tests format_value with a list of lists/dicts'

def test_format_value_table(self):

    list_of_lists = [[u'list1'], [u'list2'], [u'list3']]
    expected_list_format = u'\n                                <tableclass="tabletable-striped">\n                                                <tbody>\n                                                            <tr>\n                                                                        <th>0</th>\n                                                                        <td>list1</td>\n                                                            </tr>\n                                                            <tr>\n                                                                        <th>1</th>\n                                                                        <td>list2</td>\n                                                            </tr>\n                                                            <tr>\n                                                                        <th>2</th>\n                                                                        <td>list3</td>\n                                                            </tr>\n                                                </tbody>\n                                                </table>'
    self.assertEqual(format_html(format_value(list_of_lists)), format_html(expected_list_format))
    expected_dict_format = u'\n                                <tableclass="tabletable-striped">\n                                                <tbody>\n                                                                <tr>\n                                                                                <th>0</th>\n                                                                                <td>\n                                                                                                <tableclass="tabletable-striped">\n                                                                                                                <tbody>\n                                                                                                                                <tr>\n                                                                                                                                                <th>item1</th>\n                                                                                                                                                <td>value1</td>\n                                                                                                                                </tr>\n                                                                                                                </tbody>\n                                                                                                </table>\n                                                                                </td>\n                                                                </tr>\n                                                                <tr>\n                                                                                <th>1</th>\n                                                                                <td>\n                                                                                                <tableclass="tabletable-striped">\n                                                                                                                <tbody>\n                                                                                                                                <tr>\n                                                                                                                                                <th>item2</th>\n                                                                                                                                                <td>value2</td>\n                                                                                                                                </tr>\n                                                                                                                </tbody>\n                                                                                                </table>\n                                                                                </td>\n                                                                </tr>\n                                                                <tr>\n                                                                                <th>2</th>\n                                                                                <td>\n                                                                                                <tableclass="tabletable-striped">\n                                                                                                                <tbody>\n                                                                                                                                <tr>\n                                                                                                                                                <th>item3</th>\n                                                                                                                                                <td>value3</td>\n                                                                                                                                </tr>\n                                                                                                                </tbody>\n                                                                                                </table>\n                                                                                </td>\n                                                                </tr>\n                                                </tbody>\n                                </table>'
    list_of_dicts = [{u'item1': u'value1'}, {u'item2': u'value2'}, {u'item3': u'value3'}]
    self.assertEqual(format_html(format_value(list_of_dicts)), format_html(expected_dict_format))
