Skip to content

Commit

Permalink
bz2220965
Browse files Browse the repository at this point in the history
  • Loading branch information
lhellebr committed Dec 22, 2023
1 parent d0c8193 commit 0d604df
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pytest_fixtures/core/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


@pytest.fixture(scope='module')
def ui_user(request, module_org, module_location, module_target_sat):
def ui_user(request, module_org, module_location, module_target_sat, admin=True):
"""Creates admin user with default org set to module org and shares that
user for all tests in the same test module. User's login contains test
module name as a prefix.
Expand All @@ -19,14 +19,17 @@ def ui_user(request, module_org, module_location, module_target_sat):
password = gen_string('alphanumeric')
logger.debug('Creating session user %r', login)
user = module_target_sat.api.User(
admin=True,
admin=admin,
default_organization=module_org,
default_location=module_location,
description=f'created automatically by airgun for module "{test_module_name}"',
login=login,
password=password,
).create()
user.password = password
if not admin:
# give all the permissions
pass
yield user
try:
logger.debug('Deleting session user %r', user.login)
Expand Down

0 comments on commit 0d604df

Please sign in to comment.