          self.assertEqual(test_art.headline, 'Test headline')
          # You can create a form over a subset of the available fields
          # by specifying a 'fields' argument to form_for_instance.
          f = PartialArticleFormWithSlug({
                  'headline': 'New headline',
                  'slug': 'new-headline',
                  'pub_date': '1988-01-04'
          }, auto_id=False, instance=art)
          self.assertHTMLEqual(f.as_ul(), '''<li>Headline: <input type="text" name="headline" value="New headline" maxlength="50" /></li>
  <li>Slug: <input type="text" name="slug" value="new-headline" maxlength="50" /></li>
  <li>Pub date: <input type="text" name="pub_date" value="1988-01-04" /></li>''')
          self.assertEqual(f.is_valid(), True)
 
</s> remove                 auto_id=False,
                initial={
                    'headline': 'Your headline here',
                    'categories': [str(c1.id), str(c2.id)]
                })
 </s> add             auto_id=False,
            initial={
                'headline': 'Your headline here',
                'categories': [str(c1.id), str(c2.id)]
            }) </s> remove                     headline='Test article',
                    slug='test-article',
                    pub_date=datetime.date(1988, 1, 4),
                    writer=w,
                    article='Hello.'
                )
 </s> add             headline='Test article',
            slug='test-article',
            pub_date=datetime.date(1988, 1, 4),
            writer=w,
            article='Hello.'
        ) </s> remove                 'headline': 'Test headline',
                'slug': 'test-headline',
                'pub_date': '1984-02-06',
                'writer': six.text_type(w_royko.pk),
                'article': 'Hello.'
 </s> add             'headline': 'Test headline',
            'slug': 'test-headline',
            'pub_date': '1984-02-06',
            'writer': six.text_type(w_royko.pk),
            'article': 'Hello.' </s> remove                 'headline': 'New headline',
                'slug': 'new-headline',
                'pub_date': '1988-01-04',
                'writer': six.text_type(w_royko.pk),
                'article': 'Hello.',
                'categories': [six.text_type(c1.id), six.text_type(c2.id)]
 </s> add             'headline': 'New headline',
            'slug': 'new-headline',
            'pub_date': '1988-01-04',
            'writer': six.text_type(w_royko.pk),
            'article': 'Hello.',
            'categories': [six.text_type(c1.id), six.text_type(c2.id)] </s> remove                         form[cl.model._meta.pk.name].is_hidden)):
 </s> add                     form[cl.model._meta.pk.name].is_hidden)):
            'headline': 'New headline',
            'slug': 'new-headline',
            'pub_date': '1988-01-04'
          self.assertEqual(test_art.headline, 'Test headline')
          # You can create a form over a subset of the available fields
          # by specifying a 'fields' argument to form_for_instance.
          f = PartialArticleFormWithSlug({
            'headline': 'New headline',
            'slug': 'new-headline',
            'pub_date': '1988-01-04'
            'headline': 'New headline',
            'slug': 'new-headline',
            'pub_date': '1988-01-04'
            'headline': 'New headline',
            'slug': 'new-headline',
            'pub_date': '1988-01-04'
          }, auto_id=False, instance=art)
          self.assertHTMLEqual(f.as_ul(), '''<li>Headline: <input type="text" name="headline" value="New headline" maxlength="50" /></li>
  <li>Slug: <input type="text" name="slug" value="new-headline" maxlength="50" /></li>
  <li>Pub date: <input type="text" name="pub_date" value="1988-01-04" /></li>''')
          self.assertEqual(f.is_valid(), True)
keep keep keep keep replace replace replace keep keep keep keep keep
 Fixed #21288 -- Fixed E126 pep8 warnings 
tests/model_forms/tests.py