if (columns and not f.name in columns) or \
(exclude and f.name in exclude):
continue
- column = Column() # TODO: chose correct column type, with right options
+ column = Column(verbose_name=f.verbose_name) # TODO: chose correct column type, with right options
if column:
field_list.append((f.name, column))
field_dict = SortedDict(field_list)
columns = ('system', 'population', 'foo', 'tld',)
assert [c.name for c in CountryTable().columns] == ['system', 'population', 'foo', 'tld']
+
+ def test_columns_verbose_name(self):
+ """Tests that the model field's verbose_name is used for the column
+ """
+ class CountryTable(tables.ModelTable):
+ class Meta:
+ model = Country
+ columns = ('tld',)
+
+ assert [c.verbose_name for c in CountryTable.columns] = ['Domain Extension']
def test_basic():