Skip to content

Commit

Permalink
Reporting test fixes for stream (#17116)
Browse files Browse the repository at this point in the history
Co-authored-by: Ondřej Gajdušek <[email protected]>
  • Loading branch information
LadislavVasina1 and ogajduse authored Dec 10, 2024
1 parent c170b84 commit 5abd4bc
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/foreman/ui/test_reporttemplates.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def test_positive_generate_subscriptions_report_json(
:CaseImportance: Medium
"""
# generate Subscriptions report
with session:
with module_target_sat.ui_session() as session:
file_path = session.reporttemplate.generate(
'Subscription - General Report', values={'output_format': 'JSON'}
)
Expand All @@ -295,10 +295,12 @@ def test_positive_generate_subscriptions_report_json(
'Account number',
'Available',
'Contract number',
'Days Remaining',
'End date',
'ID',
'Name',
'Organization',
'Product Host Count',
'Quantity',
'SKU',
'Start date',
Expand Down Expand Up @@ -386,7 +388,7 @@ def test_positive_schedule_generation_and_get_mail(
# make sure postfix daemon is running
target_sat.execute('systemctl start postfix')
# generate Subscriptions report
with session:
with target_sat.ui_session() as session:
session.reporttemplate.schedule(
'Subscription - General Report',
values={
Expand Down Expand Up @@ -426,10 +428,12 @@ def test_positive_schedule_generation_and_get_mail(
'Account number',
'Available',
'Contract number',
'Days Remaining',
'End date',
'ID',
'Name',
'Organization',
'Product Host Count',
'Quantity',
'SKU',
'Start date',
Expand Down Expand Up @@ -556,9 +560,7 @@ def test_positive_installable_errata_with_user(
:BZ: 1726504
"""
activation_key = target_sat.api.ActivationKey(
environment=function_lce, organization=function_org
).create()
activation_key = target_sat.api.ActivationKey(organization=function_org).create()
custom_cv = target_sat.api.ContentView(organization=function_org).create()
ERRATUM_ID = str(settings.repos.yum_6.errata[2])
target_sat.cli_factory.setup_org_for_a_custom_repo(
Expand Down Expand Up @@ -608,7 +610,7 @@ def test_positive_installable_errata_with_user(
# Downgrade the package
assert rhel_contenthost.execute(f'yum downgrade -y {FAKE_1_CUSTOM_PACKAGE}').status == 0
# Generate the report
with session:
with target_sat.ui_session() as session:
session.organization.select(function_org.name)
session.location.select(function_location.name)
result_json = session.reporttemplate.generate(
Expand Down

0 comments on commit 5abd4bc

Please sign in to comment.