def test_manager_factory(self):

        class MockManager(AlchemyModelManager):
            model_class = mock.Mock()

            def __init__(self, *args, **kwargs):
                self.session = mock.Mock()
                super(MockManager, self).__init__(*args, **kwargs)

        class MockViewSet(AlchemyModelViewSet):
            def manager_factory(self, *args, **kwargs):
                return MockManager()

        viewset = MockViewSet()
        self.assertIsInstance(viewset.manager_factory(), MockManager)
Test if manager_factory returns back appropriate instance
dataset/ETHPy150Open dealertrack/djangorest-alchemy/djangorest_alchemy/tests/test_viewsets.py/TestAlchemyViewSetUnit.test_manager_factory