示例#1
0
 def provider(self):
     provider = RegistrationProviderFactory()
     asset_file = ProviderAssetFileFactory(
         name='square_color_no_transparent')
     provider.asset_files.add(asset_file)
     provider.access_token = None
     provider.save()
     return provider
    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')
示例#3
0
 def provider_asset_two(self, provider_two):
     return ProviderAssetFileFactory(providers=[provider_two])
示例#4
0
 def provider_asset_one(self, provider_one):
     return ProviderAssetFileFactory(providers=[provider_one])