'Even though the default manager filters out some records,
we must still be able to save (particularly, save by updating
existing records) those filtered instances. This is a
regression test for #8990, #9527'

def test_filtered_default_manager(self):

    related = RelatedModel.objects.create(name='xyzzy')
    obj = RestrictedModel.objects.create(name='hidden', related=related)
    obj.name = 'still    hidden'
    obj.save()
    self.assertEqual(RestrictedModel.plain_manager.count(), 1)
