def test_boolean_field_choices_with_real_model_instances():
 class BoolModelChoices(models.Model, ):
  field = models.BooleanField(choices=((True, u'Yes'), (False, u'No')))
  class Meta:
   app_label = u'django_tables2_test'
 class Table(tables.Table, ):
  class Meta:
   model = BoolModelChoices
 table = Table([BoolModelChoices(field=True), BoolModelChoices(field=False)])
 assert (table.rows[0].get_cell(u'field') == u'<span class="true">\u2714</span>')
 assert (table.rows[1].get_cell(u'field') == u'<span class="false">\u2718</span>')

def test_boolean_field_choices_with_real_model_instances ( ) : class BoolModelChoices ( models . Model , ) : field = models . BooleanField ( choices = ( ( True , u'Yes' ) , ( False , u'No' ) ) ) class Meta : app_label = u'django_tables2_test' class Table ( tables . Table , ) : class Meta : model = BoolModelChoices table = Table ( [ BoolModelChoices ( field = True ) , BoolModelChoices ( field = False ) ] ) assert ( table . rows [ 0 ] . get_cell ( u'field' ) == u'<span class="true">\u2714</span>' ) assert ( table . rows [ 1 ] . get_cell ( u'field' ) == u'<span class="false">\u2718</span>' )
if a booleanfield has choices defined .