'Ensure that hidden pk fields aren\'t displayed in the table body and
that their corresponding human-readable value is displayed instead.
Note that the hidden pk fields are in fact be displayed but
separately (not in the table), and only once.
Refs #12475.'

def test_pk_hidden_fields(self):

    story1 = Story.objects.create(title=u'The    adventures    of    Guido', content=u'Once    upon    a    time    in    Djangoland...')
    story2 = Story.objects.create(title=u'Crouching    Tiger,    Hidden    Python', content=u'The    Python    was    sneaking    into...')
    response = self.client.get(u'/test_admin/admin/admin_views/story/')
    self.assertContains(response, u'id="id_form-0-id"', 1)
    self.assertContains(response, u'id="id_form-1-id"', 1)
    self.assertContains(response, (u'<div    class="hiddenfields">\n<input    type="hidden"    name="form-0-id"    value="%d"    id="id_form-0-id"    /><input    type="hidden"    name="form-1-id"    value="%d"    id="id_form-1-id"    />\n</div>' % (story2.id, story1.id)), html=True)
    self.assertContains(response, (u'<td>%d</td>' % story1.id), 1)
    self.assertContains(response, (u'<td>%d</td>' % story2.id), 1)
