  <option value="3">Live</option>
  </select></li>''' % (w_woodward.pk, w_royko.pk, c1.pk, c2.pk, c3.pk))
  
          c4 = Category.objects.create(name='Fourth', url='4th')
          self.assertEqual(c4.name, 'Fourth')
          w_bernstein = Writer.objects.create(name='Carl Bernstein')
          self.assertEqual(w_bernstein.name, 'Carl Bernstein')
          self.assertHTMLEqual(f.as_ul(), '''<li>Headline: <input type="text" name="headline" maxlength="50" /></li>
  <li>Slug: <input type="text" name="slug" maxlength="50" /></li>
  <li>Pub date: <input type="text" name="pub_date" /></li>
 
</s> remove         self.assertEqual(w_bernstein.name, 'Carl Bernstein')
 </s> add  </s> remove </select></li>''' % (w_woodward.pk, w_royko.pk, c1.pk, c2.pk, c3.pk))
 </s> add </select></li>''' % (self.w_woodward.pk, self.w_royko.pk, self.c1.pk, self.c2.pk, self.c3.pk)) </s> remove         self.assertEqual(f.is_valid(), True)
 </s> add         self.assertTrue(f.is_valid()) </s> remove         # Add some categories and test the many-to-many form output.
        self.assertQuerysetEqual(new_art.categories.all(), [])
        new_art.categories.add(Category.objects.get(name='Entertainment'))
        self.assertQuerysetEqual(new_art.categories.all(), ["Entertainment"])
        f = TestArticleForm(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>
<li>Pub date: <input type="text" name="pub_date" value="1988-01-04" /></li>
<li>Writer: <select name="writer">
<option value="">---------</option>
<option value="%s">Bob Woodward</option>
<option value="%s" selected="selected">Mike Royko</option>
</select></li>
<li>Article: <textarea rows="10" cols="40" name="article">Hello.</textarea></li>
<li>Categories: <select multiple="multiple" name="categories">
<option value="%s" selected="selected">Entertainment</option>
<option value="%s">It&#39;s a test</option>
<option value="%s">Third test</option>
</select> <span class="helptext"> Hold down "Control", or "Command" on a Mac, to select more than one.</span></li>
<li>Status: <select name="status">
<option value="" selected="selected">---------</option>
<option value="1">Draft</option>
<option value="2">Pending</option>
<option value="3">Live</option>
</select></li>''' % (w_woodward.pk, w_royko.pk, c1.pk, c2.pk, c3.pk))

        # Initial values can be provided for model forms
        f = TestArticleForm(
            auto_id=False,
            initial={
                'headline': 'Your headline here',
                'categories': [str(c1.id), str(c2.id)]
            })
        self.assertHTMLEqual(f.as_ul(), '''<li>Headline: <input type="text" name="headline" value="Your headline here" maxlength="50" /></li>
<li>Slug: <input type="text" name="slug" maxlength="50" /></li>
<li>Pub date: <input type="text" name="pub_date" /></li>
<li>Writer: <select name="writer">
<option value="" selected="selected">---------</option>
<option value="%s">Bob Woodward</option>
<option value="%s">Mike Royko</option>
</select></li>
<li>Article: <textarea rows="10" cols="40" name="article"></textarea></li>
<li>Categories: <select multiple="multiple" name="categories">
<option value="%s" selected="selected">Entertainment</option>
<option value="%s" selected="selected">It&#39;s a test</option>
<option value="%s">Third test</option>
</select> <span class="helptext"> Hold down "Control", or "Command" on a Mac, to select more than one.</span></li>
<li>Status: <select name="status">
<option value="" selected="selected">---------</option>
<option value="1">Draft</option>
<option value="2">Pending</option>
<option value="3">Live</option>
</select></li>''' % (w_woodward.pk, w_royko.pk, c1.pk, c2.pk, c3.pk))

        f = TestArticleForm({
 </s> add     def test_m2m_editing(self):
        self.create_basic_data()
        form_data = {
  <option value="3">Live</option>
  </select></li>''' % (w_woodward.pk, w_royko.pk, c1.pk, c2.pk, c3.pk))
  
          c4 = Category.objects.create(name='Fourth', url='4th')

          w_bernstein = Writer.objects.create(name='Carl Bernstein')
          self.assertEqual(w_bernstein.name, 'Carl Bernstein')
          self.assertHTMLEqual(f.as_ul(), '''<li>Headline: <input type="text" name="headline" maxlength="50" /></li>
  <li>Slug: <input type="text" name="slug" maxlength="50" /></li>
  <li>Pub date: <input type="text" name="pub_date" /></li>
keep keep keep keep replace keep keep keep keep keep
 Fixed #6103 -- Splitted tests in model_forms tests 
tests/model_forms/tests.py