Skip to content

Commit

Permalink
[6.14.z] Close-loop 1757394 (#11625)
Browse files Browse the repository at this point in the history
  • Loading branch information
Satellite-QE committed Jun 8, 2023
1 parent fe12706 commit 6a668ef
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/foreman/api/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,37 @@ def test_negative_create_with_blank_authorized_by(self):
with pytest.raises(HTTPError):
entities.User(auth_source='').create()

@pytest.mark.tier1
def test_positive_table_preferences(self, module_target_sat):
"""Create a user, create their Table Preferences, read it
:id: 10fda3f1-4fee-461b-a413-a4d1fa098a94
:expectedresults: Table Preferences can be accessed
:CaseImportance: Medium
:customerscenario: true
:BZ: 1757394
"""
existing_roles = entities.Role().search()
password = gen_string('alpha')
user = entities.User(role=existing_roles, password=password).create()
name = "hosts"
columns = ["power_status", "name", "comment"]
sc = ServerConfig(auth=(user.login, password), url=module_target_sat.url, verify=False)
entities.TablePreferences(sc, user=user, name=name, columns=columns).create()
table_preferences = entities.TablePreferences(sc, user=user).search()
assert len(table_preferences) == 1
tp = table_preferences[0]
assert hasattr(tp, 'name')
assert hasattr(tp, 'columns')
assert tp.name == 'hosts'
assert len(tp.columns) == len(columns)
for column in columns:
assert column in tp.columns


class TestUserRole:
"""Test associations between users and roles."""
Expand Down

0 comments on commit 6a668ef

Please sign in to comment.