This commit is contained in:
@@ -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"]) # Другой автор с ролью редактора
|
||||
|
||||
Reference in New Issue
Block a user