Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
def _convert_model_to_dto(directory: Directory) -> AttributeTypeDTO[int]:
return AttributeTypeDTO[int](
id=directory.id,
name=directory.attributes_dict[Names.LDAP_DISPLAY_NAME][0],
name=directory.name,
ldap_display_name=directory.attributes_dict[Names.LDAP_DISPLAY_NAME][0],
oid=directory.attributes_dict[Names.OID][0],
syntax=directory.attributes_dict[Names.SYNTAX][0],
Expand Down
2 changes: 1 addition & 1 deletion interface
12 changes: 12 additions & 0 deletions tests/test_api/test_ldap_schema/test_attribute_type_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,18 @@ async def test_create_attribute_type_conflict_when_already_exists(
assert response.status_code == status.HTTP_400_BAD_REQUEST


@pytest.mark.asyncio
async def test_get_attribute_type_returns_directory_name(
http_client: AsyncClient,
) -> None:
"""Test name vs ldap_display_name for attribute type responses."""
response = await http_client.get("/schema/attribute_type/attr_with_bvalue")
assert response.status_code == status.HTTP_200_OK
data = response.json()
assert data.get("name") == "attr_with_bvalue"
assert data.get("ldap_display_name") == "attrWithBvalue"


@pytest.mark.asyncio
async def test_get_list_attribute_types_with_pagination(
http_client: AsyncClient,
Expand Down
Loading