Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close-loop 1757394 #11609

Merged
merged 1 commit into from
Jun 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()
adarshdubey-star marked this conversation as resolved.
Show resolved Hide resolved
assert len(table_preferences) == 1
tp = table_preferences[0]
assert hasattr(tp, 'name')
assert hasattr(tp, 'columns')
assert tp.name == 'hosts'
adarshdubey-star marked this conversation as resolved.
Show resolved Hide resolved
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