Skip to content
Snippets Groups Projects
Commit 095074b0 authored by Mohammad Torkashvand's avatar Mohammad Torkashvand
Browse files

opengear_subscription_factory to return object instead of str

parent 70c75d8f
No related branches found
No related tags found
1 merge request!348Feature/nat 936 refactor fixtures
import pytest
from orchestrator.db import db
from orchestrator.domain import SubscriptionModel
from orchestrator.types import SubscriptionLifecycle, UUIDstr
from orchestrator.types import SubscriptionLifecycle
from gso.products import ProductName
from gso.products.product_types.opengear import ImportedOpengearInactive, OpengearInactive
......@@ -23,7 +23,7 @@ def opengear_subscription_factory(site_subscription_factory, faker, geant_partne
partner: dict | None = None,
*,
is_imported: bool | None = False,
) -> UUIDstr:
) -> SubscriptionModel:
if partner is None:
partner = geant_partner
......@@ -63,6 +63,6 @@ def opengear_subscription_factory(site_subscription_factory, faker, geant_partne
opengear_subscription.save()
db.session.commit()
return str(opengear_subscription.subscription_id)
return opengear_subscription
return subscription_create
......@@ -8,7 +8,7 @@ from test.workflows import assert_complete, run_workflow
@pytest.mark.workflow()
def test_import_office_router_success(opengear_subscription_factory):
imported_opengear = opengear_subscription_factory(is_imported=True)
imported_opengear = str(opengear_subscription_factory(is_imported=True).subscription_id)
result, _, _ = run_workflow("import_opengear", [{"subscription_id": imported_opengear}])
subscription = Opengear.from_subscription(imported_opengear)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment