rbac-fixes
Some checks failed
Deploy on push / deploy (push) Failing after 2m36s

This commit is contained in:
2025-08-20 19:48:28 +03:00
parent 3d703ed983
commit 59767bdae4
6 changed files with 167 additions and 132 deletions

View File

@@ -92,11 +92,11 @@ async def setup_test_data(db_session) -> tuple[Author, Shout, Author]:
db_session.commit()
# Добавляем роли пользователям в БД
assign_role_to_user(test_author.id, "reader")
assign_role_to_user(test_author.id, "author")
assign_role_to_user(other_author.id, "reader")
assign_role_to_user(other_author.id, "author")
# Добавляем роли пользователям в БД с передачей сессии
assign_role_to_user(test_author.id, "reader", session=db_session)
assign_role_to_user(test_author.id, "author", session=db_session)
assign_role_to_user(other_author.id, "reader", session=db_session)
assign_role_to_user(other_author.id, "author", session=db_session)
logger.info(
f" ✅ Созданы: автор {test_author.id}, другой автор {other_author.id}, публикация {test_shout.id}"
@@ -154,10 +154,10 @@ async def test_unpublish_by_editor(db_session) -> None:
session.add(shout)
session.commit()
# Добавляем роль "editor" другому автору в БД
assign_role_to_user(other_author.id, "reader")
assign_role_to_user(other_author.id, "author")
assign_role_to_user(other_author.id, "editor")
# Добавляем роль "editor" другому автору в БД с передачей сессии
assign_role_to_user(other_author.id, "reader", session=db_session)
assign_role_to_user(other_author.id, "author", session=db_session)
assign_role_to_user(other_author.id, "editor", session=db_session)
logger.info(" 📝 Тест: Снятие публикации редактором")
info = MockInfo(other_author.id, roles=["reader", "author", "editor"]) # Другой автор с ролью редактора