

def test_custom_field(self):

    class CustomTable(Table):

        def url(self, item):
            return 'custom_value'
        url.title = 'custom_title'
    table = CustomTable(Foo.objects.all(), ['id', 'bar', 'url'])
    result = [['ID', 'bar', 'custom_title'], [{
        'value': self.foo_1.id,
        'html_attributes': '',
    }, {
        'value': 'Test1',
        'html_attributes': '',
    }, {
        'value': 'custom_value',
        'html_attributes': '',
    }]]
    self.assertListEqual(result.get_table_content(), result)

dataset/ETHPy150Open allegro/ralph/src/ralph/lib/table/tests.py TableRenderTestCase.test_custom_field/VarMisuse@126/183 `table`->`result`