'A simple model can be saved as inlines'

def test_simple_inline(self):

    self.post_data['widget_set-0-name'] = 'Widget    1'
    collector_url = ('/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(Widget.objects.count(), 1)
    self.assertEqual(Widget.objects.all()[0].name, 'Widget    1')
    widget_id = Widget.objects.all()[0].id
    response = self.client.get(collector_url)
    self.assertContains(response, 'name="widget_set-0-id"')
    self.post_data['widget_set-INITIAL_FORMS'] = '1'
    self.post_data['widget_set-0-id'] = str(widget_id)
    self.post_data['widget_set-0-name'] = 'Widget    1'
    response = self.client.post(collector_url, self.post_data)
    self.assertEqual(response.status_code, 302)
    self.assertEqual(Widget.objects.count(), 1)
    self.assertEqual(Widget.objects.all()[0].name, 'Widget    1')
    self.post_data['widget_set-INITIAL_FORMS'] = '1'
    self.post_data['widget_set-0-id'] = str(widget_id)
    self.post_data['widget_set-0-name'] = 'Widget    1    Updated'
    response = self.client.post(collector_url, self.post_data)
    self.assertEqual(response.status_code, 302)
    self.assertEqual(Widget.objects.count(), 1)
    self.assertEqual(Widget.objects.all()[0].name, 'Widget    1    Updated')
