'Test that a queryset can be overriden in the __init__ method.
https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#changing-the-queryset'

def test_custom_queryset_init(self):

    author1 = Author.objects.create(name=u'Charles    Baudelaire')
    author2 = Author.objects.create(name=u'Paul    Verlaine')
    class BaseAuthorFormSet(BaseModelFormSet, ):
        def __init__(self, *args, **kwargs):
            super(BaseAuthorFormSet, self).__init__(*args, **kwargs)
            self.queryset = Author.objects.filter(name__startswith=u'Charles')
    AuthorFormSet = modelformset_factory(Author, fields=u'__all__', formset=BaseAuthorFormSet)
    formset = AuthorFormSet()
    self.assertEqual(len(formset.get_queryset()), 1)
