          #Ensure many-to-many relation appears as a list
          self.assertIsInstance(d['categories'], list)
  
  
  class OldFormForXTests(TestCase):
      def test_base_form(self):
          self.assertEqual(Category.objects.count(), 0)
          f = BaseCategoryForm()
          self.assertHTMLEqual(
              str(f),
 
</s> remove         self.assertEqual(f.is_valid(), True)
        self.assertEqual(f.cleaned_data['url'], 'third')
        self.assertEqual(f.cleaned_data['name'], 'Third test')
        self.assertEqual(f.cleaned_data['slug'], 'third-test')
        c3 = f.save(commit=False)
        self.assertEqual(c3.name, "Third test")
        self.assertEqual(Category.objects.count(), 2)
        c3.save()
        self.assertEqual(Category.objects.count(), 3)
 </s> add         self.assertTrue(f.is_valid())
        c1 = f.save(commit=False)
        self.assertEqual(c1.name, "Third test")
        self.assertEqual(Category.objects.count(), 0)
        c1.save()
        self.assertEqual(Category.objects.count(), 1) </s> remove         self.assertEqual(f.is_valid(), False)
 </s> add         self.assertFalse(f.is_valid()) </s> remove         self.assertEqual(f.is_valid(), False)
 </s> add         self.assertFalse(f.is_valid())
class ModelFormBasicTests(TestCase):
    def create_basic_data(self):
        self.c1 = Category.objects.create(
            name="Entertainment", slug="entertainment", url="entertainment")
        self.c2 = Category.objects.create(
            name="It's a test", slug="its-test", url="test")
        self.c3 = Category.objects.create(
            name="Third test", slug="third-test", url="third")
        self.w_royko = Writer.objects.create(name='Mike Royko')
        self.w_woodward = Writer.objects.create(name='Bob Woodward')

          #Ensure many-to-many relation appears as a list
          self.assertIsInstance(d['categories'], list)
  
  
class ModelFormBasicTests(TestCase):
    def create_basic_data(self):
        self.c1 = Category.objects.create(
            name="Entertainment", slug="entertainment", url="entertainment")
        self.c2 = Category.objects.create(
            name="It's a test", slug="its-test", url="test")
        self.c3 = Category.objects.create(
            name="Third test", slug="third-test", url="third")
        self.w_royko = Writer.objects.create(name='Mike Royko')
        self.w_woodward = Writer.objects.create(name='Bob Woodward')

      def test_base_form(self):
          self.assertEqual(Category.objects.count(), 0)
          f = BaseCategoryForm()
          self.assertHTMLEqual(
              str(f),
keep keep keep keep replace keep keep keep keep keep
 Fixed #6103 -- Splitted tests in model_forms tests 
tests/model_forms/tests.py