          # ORM... not the fastest way...
  
          self.assertEqual(c1, Category.objects.all()[0])
          self.assertEqual(c1.name, "Entertainment")
          self.assertEqual(Category.objects.count(), 1)
  
          f = BaseCategoryForm({'name': "It's a test",
                                'slug': 'its-test',
                                'url': 'test'})
          self.assertTrue(f.is_valid())
          self.assertEqual(f.cleaned_data['name'], "It's a test")
          self.assertEqual(f.cleaned_data['slug'], 'its-test')
          self.assertEqual(f.cleaned_data['url'], 'test')
          c2 = f.save()
          # Testing wether the same object is returned from the
          # ORM... not the fastest way...
          self.assertEqual(c2, Category.objects.get(pk=c2.pk))
          self.assertEqual(c2.name, "It's a test")
          self.assertEqual(Category.objects.count(), 2)
  
          # If you call save() with commit=False, then it will return an object that
          # hasn't yet been saved to the database. In this case, it's up to you to call
          # save() on the resulting model instance.
          f = BaseCategoryForm({'name': 'Third test', 'slug': 'third-test', 'url': 'third'})
 
</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         cat = Category.objects.get(name='Third test')
        self.assertEqual(cat.name, "Third test")
        self.assertEqual(cat.id == c3.id, True)
 </s> add         class ShortCategory(forms.ModelForm):
            name = forms.CharField(max_length=5)
            slug = forms.CharField(max_length=5)
            url = forms.CharField(max_length=3)

            class Meta:
                model = Category
                fields = '__all__'

        cat = Category.objects.create(name='Third test')
          # ORM... not the fastest way...
  
          self.assertEqual(c1, Category.objects.all()[0])
          self.assertEqual(c1.name, "Entertainment")















  
          # If you call save() with commit=False, then it will return an object that
          # hasn't yet been saved to the database. In this case, it's up to you to call
          # save() on the resulting model instance.
          f = BaseCategoryForm({'name': 'Third test', 'slug': 'third-test', 'url': 'third'})
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Fixed #6103 -- Splitted tests in model_forms tests 
tests/model_forms/tests.py