  
          # Here, we define a custom ModelForm. Because it happens to have the same fields as
          # the Category model, we can just call the form's save() to apply its changes to an
          # existing Category instance.
          cat = Category.objects.get(name='Third test')
          self.assertEqual(cat.name, "Third test")
          self.assertEqual(cat.id == c3.id, True)
          form = ShortCategory({'name': 'Third', 'slug': 'third', 'url': '3rd'}, instance=cat)
          self.assertEqual(form.save().name, 'Third')
          self.assertEqual(Category.objects.get(id=c3.id).name, 'Third')
  
          # Here, we demonstrate that choices for a ForeignKey ChoiceField are determined
 
</s> remove         self.assertQuerysetEqual(new_art.categories.order_by('name'), ["Entertainment", "It's a test"])
 </s> add         self.assertQuerysetEqual(new_art.categories.order_by('name'),
            ["Entertainment", "It's a test"]) </s> remove         self.assertEqual(Category.objects.get(id=c3.id).name, 'Third')
 </s> add         self.assertEqual(Category.objects.get(id=cat.id).name, 'Third')
        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')
  
          # Here, we define a custom ModelForm. Because it happens to have the same fields as
          # the Category model, we can just call the form's save() to apply its changes to an
          # existing Category instance.
        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')
        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')
        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')
          form = ShortCategory({'name': 'Third', 'slug': 'third', 'url': '3rd'}, instance=cat)
          self.assertEqual(form.save().name, 'Third')
          self.assertEqual(Category.objects.get(id=c3.id).name, 'Third')
  
          # Here, we demonstrate that choices for a ForeignKey ChoiceField are determined
keep keep keep keep replace replace replace keep keep keep keep keep
 Fixed #6103 -- Splitted tests in model_forms tests 
tests/model_forms/tests.py