'A model with an explicit autofield primary key can be saved as inlines. Regression for #8093'

def test_explicit_autofield_inline(self):

    self.post_data[u'grommet_set-0-name'] = u'Grommet    1'
    collector_url = (u'/test_admin/admin/admin_views/collector/%d/' % self.collector.pk)
    response = self.client.post(collector_url, self.post_data)
    self.assertEqual(response.status_code, 302)
    self.assertEqual(Grommet.objects.count(), 1)
    self.assertEqual(Grommet.objects.all()[0].name, u'Grommet    1')
    response = self.client.get(collector_url)
    self.assertContains(response, u'name="grommet_set-0-code"')
    self.post_data[u'grommet_set-INITIAL_FORMS'] = u'1'
    self.post_data[u'grommet_set-0-code'] = str(Grommet.objects.all()[0].code)
    self.post_data[u'grommet_set-0-name'] = u'Grommet    1'
    response = self.client.post(collector_url, self.post_data)
    self.assertEqual(response.status_code, 302)
    self.assertEqual(Grommet.objects.count(), 1)
    self.assertEqual(Grommet.objects.all()[0].name, u'Grommet    1')
    self.post_data[u'grommet_set-INITIAL_FORMS'] = u'1'
    self.post_data[u'grommet_set-0-code'] = str(Grommet.objects.all()[0].code)
    self.post_data[u'grommet_set-0-name'] = u'Grommet    1    Updated'
    response = self.client.post(collector_url, self.post_data)
    self.assertEqual(response.status_code, 302)
    self.assertEqual(Grommet.objects.count(), 1)
    self.assertEqual(Grommet.objects.all()[0].name, u'Grommet    1    Updated')
