'If a LogEntry is missing content_type it will not display it in span tag under the hyperlink.'

def test_recentactions_without_content_type(self):

    response = self.client.get(u'/test_admin/admin/')
    link = reverse(u'admin:admin_views_modelwithstringprimarykey_change', args=(quote(self.pk),))
    should_contain = (u'<a    href="%s">%s</a>' % (link, escape(self.pk)))
    self.assertContains(response, should_contain)
    should_contain = u'Model    with    string    primary    key'
    self.assertContains(response, should_contain)
    logentry = LogEntry.objects.get(content_type__name__iexact=should_contain)
    logentry.content_type = None
    logentry.save()
    counted_presence_before = response.content.count(force_bytes(should_contain))
    response = self.client.get(u'/test_admin/admin/')
    counted_presence_after = response.content.count(force_bytes(should_contain))
    self.assertEqual((counted_presence_before - 1), counted_presence_after)
