Skip to content

lime_app_other_non_admin

Scope: function | Returns: LimeApplication

The lime_app_other_non_admin fixture provides a second LimeApplication instance running as a different non-admin user. Use it when a test needs to verify interactions between two distinct non-admin users. In all other cases, lime_app or lime_app_non_admin is sufficient.

Warning

An error is raised if the user provided by other_non_admin_user is a member of the Administrators group.

Basic usage

def test_apps_run_as_distinct_users(
    lime_app_non_admin, lime_app_other_non_admin
):
    assert lime_app_non_admin.user.id != lime_app_other_non_admin.user.id

Extending the fixture

Override lime_app_other_non_admin in your conftest.py to run additional setup after the application is ready. pytest resolves the lime_app_other_non_admin parameter to the definition from lime_test, so the override can build on top of it:

@pytest.fixture
def lime_app_other_non_admin(lime_app_other_non_admin, save_lime_objects):
    coworker = lime_app_other_non_admin.limetypes.coworker(firstname="Other", lastname="User")
    save_lime_objects(coworker, application=lime_app_other_non_admin)
    return lime_app_other_non_admin

Configurable dependencies

Fixture Controls Default
lime_app_other_non_admin_acl Access control layer AlwaysAllowAcl — all operations permitted
other_non_admin_user The user the application runs as User with username standard_2 fetched from the database
lime_db_app_config Application configuration Empty AppConfig