          self.assertHTMLEqual(six.text_type(CustomFieldForExclusionForm()),
                           '''<tr><th><label for="id_name">Name:</label></th><td><input id="id_name" type="text" name="name" maxlength="10" /></td></tr>''')
  
      def test_iterable_model_m2m(self):
          colour = Colour.objects.create(name='Blue')
          form = ColourfulItemForm()
          self.maxDiff = 1024
          self.assertHTMLEqual(
              form.as_p(),
              """<p><label for="id_name">Name:</label> <input id="id_name" type="text" name="name" maxlength="50" /></p>
 
</s> remove         # When the ModelForm is passed an instance, that instance's current values are
        # inserted as 'initial' data in each Field.
        w = Writer.objects.get(name='Mike Royko')
        f = RoykoForm(auto_id=False, instance=w)
        self.assertHTMLEqual(six.text_type(f), '''<tr><th>Name:</th><td><input type="text" name="name" value="Mike Royko" maxlength="50" /><br /><span class="helptext">Use both first and last names.</span></td></tr>''')

        art = Article(
            headline='Test article',
            slug='test-article',
            pub_date=datetime.date(1988, 1, 4),
            writer=w,
            article='Hello.'
        )
        art.save()
        art_id_1 = art.id
        self.assertEqual(art_id_1 is not None, True)
        f = TestArticleForm(auto_id=False, instance=art)
        self.assertHTMLEqual(f.as_ul(), '''<li>Headline: <input type="text" name="headline" value="Test article" maxlength="50" /></li>
<li>Slug: <input type="text" name="slug" value="test-article" maxlength="50" /></li>
 </s> add         # Add some categories and test the many-to-many form output.
        new_art = Article.objects.create(
            article="Hello.", headline="New headline", slug="new-headline",
            pub_date=datetime.date(1988, 1, 4), writer=self.w_royko)
        new_art.categories.add(Category.objects.get(name='Entertainment'))
        self.assertQuerysetEqual(new_art.categories.all(), ["Entertainment"])
        f = ArticleForm(auto_id=False, instance=new_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> </s> remove         self.assertEqual(w_bernstein.name, 'Carl Bernstein')
 </s> add  </s> remove         self.assertEqual(c4.name, 'Fourth')
 </s> add  </s> remove         self.assertEqual(f.is_valid(), True)
 </s> add         self.assertTrue(f.is_valid()) </s> remove         # Create a couple of Writers.
        w_royko = Writer(name='Mike Royko')
        w_royko.save()
        w_woodward = Writer(name='Bob Woodward')
        w_woodward.save()
 </s> add     def test_multi_fields(self):
        self.create_basic_data()
        self.maxDiff = None
        class ColourfulItemForm(forms.ModelForm):
            class Meta:
                model = ColourfulItem
                fields = '__all__'

          self.assertHTMLEqual(six.text_type(CustomFieldForExclusionForm()),
                           '''<tr><th><label for="id_name">Name:</label></th><td><input id="id_name" type="text" name="name" maxlength="10" /></td></tr>''')
  
      def test_iterable_model_m2m(self):
        class ColourfulItemForm(forms.ModelForm):
            class Meta:
                model = ColourfulItem
                fields = '__all__'

          colour = Colour.objects.create(name='Blue')
          form = ColourfulItemForm()
          self.maxDiff = 1024
          self.assertHTMLEqual(
              form.as_p(),
              """<p><label for="id_name">Name:</label> <input id="id_name" type="text" name="name" maxlength="50" /></p>
keep keep keep add keep keep keep keep keep keep
 Fixed #6103 -- Splitted tests in model_forms tests 
tests/model_forms/tests.py