Skip to content

Commit

Permalink
[6.12.z] Fix setting_update fixture to handle None value (#12416)
Browse files Browse the repository at this point in the history
  • Loading branch information
Satellite-QE authored Aug 30, 2023
1 parent cec3318 commit ae0f33f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pytest_fixtures/component/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def setting_update(request, target_sat):
key_val = request.param
setting, new_value = tuple(key_val.split('=')) if '=' in key_val else (key_val, None)
setting_object = target_sat.api.Setting().search(query={'search': f'name={setting}'})[0]
default_setting_value = setting_object.value
default_setting_value = '' if setting_object.value is None else setting_object.value
if new_value is not None:
setting_object.value = new_value
setting_object.update({'value'})
Expand Down
3 changes: 2 additions & 1 deletion tests/foreman/ui/test_http_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ def test_set_default_http_proxy(module_org, module_location, setting_update, tar
:CaseLevel: Acceptance
"""

property_name = setting_update.name

http_proxy_a = target_sat.api.HTTPProxy(
Expand All @@ -224,6 +223,8 @@ def test_set_default_http_proxy(module_org, module_location, setting_update, tar
).create()

with target_sat.ui_session() as session:
session.organization.select(org_name=module_org.name)
session.location.select(loc_name=module_location.name)
session.settings.update(
f'name = {property_name}', f'{http_proxy_a.name} ({http_proxy_a.url})'
)
Expand Down

0 comments on commit ae0f33f

Please sign in to comment.