From 25a8acf565bd0ddbcf37e29b84b3723c006fbad8 Mon Sep 17 00:00:00 2001 From: Martin Pentrak Date: Mon, 14 Oct 2024 13:32:43 +0200 Subject: [PATCH] PUT /admin/api/accounts/{id} --- tests/integration/conftest.py | 7 +++++++ tests/integration/test_integration_accounts.py | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 33249f1..32c2767 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -102,6 +102,13 @@ def access_token(access_token_params, api): cleanup(entity) +@pytest.fixture(scope='module') +def update_account_params(): + suffix = secrets.token_urlsafe(8) + name = f"updated-{suffix}" + return dict(name=name, username=name, org_name=name) + + @pytest.fixture(scope='module') def account_params(): suffix = get_suffix() diff --git a/tests/integration/test_integration_accounts.py b/tests/integration/test_integration_accounts.py index 9eda751..406b03d 100644 --- a/tests/integration/test_integration_accounts.py +++ b/tests/integration/test_integration_accounts.py @@ -1,3 +1,7 @@ +import secrets + +import pytest + from tests.integration import asserts @@ -11,6 +15,12 @@ def test_account_can_be_created(api, account, account_params): asserts.assert_resource_params(account, account_params) +def test_account_can_be_updated(api,account,update_account_params): + updated_account = account.update(params=update_account_params) + asserts.assert_resource(updated_account) + asserts.assert_resource_params(updated_account,update_account_params) + + def test_account_can_be_read(api, account, account_params): read = api.accounts.read(account.entity_id) asserts.assert_resource(read)