Skip to content

Commit d22f056

Browse files
committed
Modify test for Service Subscriptions
1 parent 9913377 commit d22f056

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11

2-
32
from tests.integration import asserts
43

54
def test_list_service_subscriptions(account):
@@ -15,21 +14,16 @@ def test_read_service_subscription(account, service_subscription, service_subscr
1514
asserts.assert_resource(resource)
1615
asserts.assert_resource_params(service_subscription,service_subscription_params)
1716

18-
19-
def test_change_plan_service_subscription(account, account_plan, service_subscription):
17+
def test_change_plan_service_subscription(account, account_plan, service_plan, service_subscription):
2018
asserts.assert_resource(account)
2119
asserts.assert_resource(account_plan)
22-
resource = account.service_subscriptions.change_plan(service_subscription.entity_id,
23-
account_plan.entity_id)
24-
asserts.assert_resource(resource)
25-
20+
account.service_subscriptions.change_plan(service_subscription.entity_id,
21+
service_plan.entity_id)
2622

2723
# TODO: https://issues.redhat.com/browse/THREESCALE-11693
2824
def test_approve_service_subscription(account, service_subscription,service_subscription_params):
2925
asserts.assert_resource(service_subscription)
3026
service_subscription['state'] = 'pending'
31-
account.service_subscriptions.update(service_subscription.entity_id,
32-
service_subscription_params)
3327
resource = account.service_subscriptions.approve(service_subscription.entity_id)
3428
asserts.assert_resource(resource)
3529
asserts.assert_resource_params(service_subscription, service_subscription_params)

threescale_api/resources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def approve(self, entity_id: int, **kwargs):
294294
def change_plan(self, entity_id: int, plan_id: int, **kwargs):
295295
params = {"plan_id": plan_id}
296296
url = self.url + f"/{entity_id}/change_plan"
297-
response = self.rest.put(url=url, params=params)
297+
response = self.rest.put(url=url, json=params, **kwargs)
298298
instance = utils.extract_response(response=response)
299299
return instance
300300

0 commit comments

Comments
 (0)