def view(self, req, provider): plain_view = views.CreatePreprintProvider() view = setup_form_view(plain_view, req, form=PreprintProviderForm()) view.kwargs = { '{}_provider_id'.format(provider.readable_type): provider.id } return view
def setUp(self): super(TestCreatePreprintProvider, self).setUp() self.user = AuthUserFactory() self.preprint_provider = PreprintProviderFactory() self.request = RequestFactory().get('/fake_path') self.request.user = self.user self.view = views.CreatePreprintProvider() self.view = setup_form_view(self.view, self.request, form=PreprintProviderForm()) self.view.kwargs = {'preprint_provider_id': self.preprint_provider.id}