@pytest.mark.django_db
def test_linkcolumn_non_field_based():
 class Table(tables.Table, ):
  first_name = tables.Column()
  delete_link = tables.LinkColumn(u'person_delete', text=u'delete', kwargs={u'pk': tables.A(u'id')})
 willem = Person.objects.create(first_name=u'Willem', last_name=u'Wever')
 html = Table(Person.objects.all()).as_html(build_request())
 expected = u'<td class="delete_link"><a href="{}">delete</a></td>'.format(reverse(u'person_delete', kwargs={u'pk': willem.pk}))
 assert (expected in html)

@ pytest . mark . django_db def test_linkcolumn_non_field_based ( ) : class Table ( tables . Table , ) : first_name = tables . Column ( ) delete_link = tables . LinkColumn ( u'person_delete' , text = u'delete' , kwargs = { u'pk' : tables . A ( u'id' ) } ) willem = Person . objects . create ( first_name = u'Willem' , last_name = u'Wever' ) html = Table ( Person . objects . all ( ) ) . as_html ( build_request ( ) ) expected = u'<td class="delete_link"><a href="{}">delete</a></td>' . format ( reverse ( u'person_delete' , kwargs = { u'pk' : willem . pk } ) ) assert ( expected in html )
test for issue 257 .