Exemple #1
0
 def import_tenant(self, user='******'):
     self.client.force_authenticate(getattr(self.fixture, user))
     payload = {
         'backend_id': self.backend_tenant.backend_id,
         'project': self.fixture.project.uuid.hex,
     }
     url = OfferingFactory.get_url(self.offering, 'import_resource')
     self.mocked_keystone.return_value.projects.get.return_value = MOCK_TENANT
     return self.client.post(url, payload)
Exemple #2
0
 def setUp(self):
     self.list_url = reverse('marketplace-offering-activate-request-list')
     self.fixture = SupportFixture()
     self.offering = self.fixture.offering
     self.offering.state = Offering.States.DRAFT
     self.offering.save()
     self.plan = self.fixture.plan
     self.user = UserFactory()
     self.offering_url = OfferingFactory.get_url(self.offering)
Exemple #3
0
 def setUp(self) -> None:
     super(InvoiceItemPullTest, self).setUp()
     patcher = mock.patch(
         'waldur_mastermind.marketplace_remote.utils.WaldurClient')
     self.client_mock = patcher.start()
     self.fixture = ProjectFixture()
     offering = OfferingFactory(
         type=PLUGIN_NAME,
         secret_options={
             'api_url': 'https://remote-waldur.com/',
             'token': 'valid_token',
             'customer_uuid': 'customer-uuid',
         },
     )
     self.customer = self.fixture.customer
     self.resource = ResourceFactory(project=self.fixture.project,
                                     offering=offering)
     self.resource.backend_id = 'valid-backend-id'
     self.resource.save()
 def setUp(self) -> None:
     super().setUp()
     patcher = mock.patch(
         'waldur_mastermind.marketplace_remote.utils.WaldurClient')
     self.client_mock = patcher.start()
     fixture = ProjectFixture()
     offering = OfferingFactory(
         type=PLUGIN_NAME,
         secret_options={
             'api_url': 'https://remote-waldur.com/',
             'token': 'valid_token',
         },
     )
     order = OrderFactory(project=fixture.project,
                          state=Order.States.EXECUTING)
     self.resource = ResourceFactory(project=fixture.project,
                                     offering=offering)
     self.order_item = OrderItemFactory(
         order=order,
         offering=offering,
         resource=self.resource,
         state=OrderItem.States.EXECUTING,
     )
Exemple #5
0
 def setUp(self):
     super(CreateResourceFlowTest, self).setUp()
     self.list_url = reverse('marketplace-resource-creation-flow-list')
     self.fixture = SupportFixture()
     self.offering = self.fixture.offering
     self.offering.state = Offering.States.ACTIVE
     self.offering.save()
     self.plan = self.fixture.plan
     self.user = UserFactory()
     self.payload = {
         'customer_create_request': {
             'name': 'XYZ corp'
         },
         'project_create_request': {
             'name': 'First project'
         },
         'resource_create_request': {
             'name': 'Test VM',
             'offering': OfferingFactory.get_url(self.offering),
             'plan': PlanFactory.get_url(self.plan),
             'attributes': {},
         },
     }
Exemple #6
0
 def setUp(self):
     super(TenantImportableResourcesTest, self).setUp()
     self.offering = marketplace_factories.OfferingFactory(
         scope=self.fixture.openstack_service_settings, type=TENANT_TYPE)
     self.url = OfferingFactory.get_url(self.offering,
                                        'importable_resources')
Exemple #7
0
 def setUp(self):
     super(VolumeImportTest, self).setUp()
     self.url = OfferingFactory.get_url(self.offering, 'import_resource')
     self.client.force_authenticate(self.fixture.owner)
Exemple #8
0
 def setUp(self):
     super(InstanceImportableResourcesTest, self).setUp()
     self.url = OfferingFactory.get_url(self.offering,
                                        'importable_resources')
     self.client.force_authenticate(self.fixture.owner)