def test_factory(self): func = action_export_factory('csv') assert func.__name__ == 'export_csv_func' func = action_export_factory('xlsx') assert func.__name__ == 'export_xlsx_func' with pytest.raises(ImproperlyConfigured): action_export_factory('test')
def test_factory_call_xlsx(self, func_mock, func_mock2): func = action_export_factory('xlsx') func() assert func_mock.call_count == 0 assert func_mock2.call_count == 1
def test_factory_call_csv(self, func_mock, func_mock2): func = action_export_factory('csv') func() assert func_mock.call_count == 1 assert func_mock2.call_count == 0