@pytest.mark.django_db
def test_boolean_field_choices_spanning_relations():
 class Table(tables.Table, ):
  boolean = tables.BooleanColumn(accessor=u'occupation.boolean_with_choices')
  class Meta:
   model = Person
 model_true = Occupation.objects.create(name=u'true-name', boolean_with_choices=True)
 model_false = Occupation.objects.create(name=u'false-name', boolean_with_choices=False)
 table = Table([Person(first_name=u'True', last_name=u'False', occupation=model_true), Person(first_name=u'True', last_name=u'False', occupation=model_false)])
 assert (table.rows[0].get_cell(u'boolean') == u'<span class="true">\u2714</span>')
 assert (table.rows[1].get_cell(u'boolean') == u'<span class="false">\u2718</span>')

@ pytest . mark . django_db def test_boolean_field_choices_spanning_relations ( ) : class Table ( tables . Table , ) : boolean = tables . BooleanColumn ( accessor = u'occupation.boolean_with_choices' ) class Meta : model = Person model_true = Occupation . objects . create ( name = u'true-name' , boolean_with_choices = True ) model_false = Occupation . objects . create ( name = u'false-name' , boolean_with_choices = False ) table = Table ( [ Person ( first_name = u'True' , last_name = u'False' , occupation = model_true ) , Person ( first_name = u'True' , last_name = u'False' , occupation = model_false ) ] ) assert ( table . rows [ 0 ] . get_cell ( u'boolean' ) == u'<span class="true">\u2714</span>' ) assert ( table . rows [ 1 ] . get_cell ( u'boolean' ) == u'<span class="false">\u2718</span>' )
the inverse lookup voor boolean choices should also work on related models .