def setUp(self): self.user = AuthUserFactory() self.user.is_superuser = True self.user.save() self.preprint_provider = PreprintProviderFactory() self.request = RequestFactory().get('/fake_path') self.view = views.ShareSourcePreprintProvider() self.view = setup_user_view(self.view, self.request, user=self.user) self.view.kwargs = {'preprint_provider_id': self.preprint_provider.id}
def setUp(self): self.user = AuthUserFactory() self.user.is_superuser = True self.user.save() self.preprint_provider = PreprintProviderFactory() asset_file = ProviderAssetFileFactory(name='square_color_no_transparent') self.preprint_provider.asset_files.add(asset_file) self.preprint_provider.save() self.request = RequestFactory().get('/fake_path') self.view = views.ShareSourcePreprintProvider() self.view = setup_user_view(self.view, self.request, user=self.user, preprint_provider_id=self.preprint_provider.id) self.mock_prepend = mock.patch.object(website.settings, 'SHARE_PROVIDER_PREPEND', 'testenv')