Adding ability to edit attachment points on augmented item details

This commit is contained in:
Ian Roddis committed 2026-07-28 22:04:40 -03:00
1 parent 25fccd617f
commit aef60d77be
5 files changed
+83 -37

No files matched your search

+30
View File
@@ -91,6 +91,36 @@ async def test_detail_shows_attributes_and_fits_readonly(
assert "Add fit" not in body
assert "Mark Exact" not in body
assert "Recompute possible fits" not in body
# ...and attachment-point add/edit/delete controls are hidden too
assert 'name="attachment_point_name_id"' not in body
assert "Delete this attachment point?" not in body
@pytest.mark.asyncio
async def test_detail_write_controls_for_attachment_point_editor(
client, seeded, make_user, db_sessionmaker
):
async with db_sessionmaker() as db:
ids = await _seed_part_with_fit(db)
perms = seeded["perms"]
editor = await role_crud.create(
db,
name="ap-editor",
permission_ids=[
perms["augmented_parts:read"].id,
perms["attachment_points:read"].id,
perms["attachment_points:write"].id,
],
)
editor_id = editor.id
await make_user("apeditor@example.com", role_ids=[editor_id])
await _web_login(client, "apeditor@example.com")
resp = await client.get(f"/admin/augmented-parts/{ids['scope_id']}")
assert resp.status_code == 200
body = resp.text
assert 'name="attachment_point_name_id"' in body
assert "Delete this attachment point?" in body
@pytest.mark.asyncio