          self.assertIsInstance(f.clean(()), EmptyQuerySet)
          with self.assertRaises(ValidationError):
              f.clean(['0'])
          with self.assertRaises(ValidationError):
              f.clean([str(c3.id), '0'])
          with self.assertRaises(ValidationError):
              f.clean([str(c1.id), '0'])
  
          # queryset can be changed after the field is created.
          f.queryset = Category.objects.exclude(name='Fourth')
 
</s> remove             f.clean([str(c1.id), '0'])
 </s> add             f.clean([str(self.c1.id), '0']) </s> remove         f.queryset = Category.objects.exclude(name='Fourth')
 </s> add         f.queryset = Category.objects.exclude(name='Third') </s> remove             (c1.pk, 'Entertainment'),
            (c2.pk, "It's a test"),
            (c3.pk, 'Third')])
        self.assertQuerysetEqual(f.clean([c3.id]), ["Third"])
 </s> add             (self.c1.pk, 'Entertainment'),
            (self.c2.pk, "It's a test")])
        self.assertQuerysetEqual(f.clean([self.c2.id]), ["It's a test"]) </s> remove         f.queryset = Category.objects.exclude(name='Fourth')
 </s> add         f.queryset = Category.objects.exclude(name='Third') </s> remove         f = forms.ModelChoiceField(Category.objects.filter(pk=c1.id), required=False)
        self.assertEqual(f.clean(''), None)
        f.clean('')
        self.assertEqual(f.clean(str(c1.id)).name, "Entertainment")
 </s> add     def test_modelchoicefield_choices(self):
        self.create_categories()
        f = forms.ModelChoiceField(Category.objects.filter(pk=self.c1.id), required=False)
        self.assertIsNone(f.clean(''))
        self.assertEqual(f.clean(str(self.c1.id)).name, "Entertainment")
            f.clean([str(self.c3.id), '0'])
          self.assertIsInstance(f.clean(()), EmptyQuerySet)
          with self.assertRaises(ValidationError):
              f.clean(['0'])
          with self.assertRaises(ValidationError):
            f.clean([str(self.c3.id), '0'])
          with self.assertRaises(ValidationError):
              f.clean([str(c1.id), '0'])
  
          # queryset can be changed after the field is created.
          f.queryset = Category.objects.exclude(name='Fourth')
keep keep keep keep replace keep keep keep keep keep
 Fixed #6103 -- Splitted tests in model_forms tests 
tests/model_forms/tests.py