load authors by followers fix
Some checks failed
Deploy on push / deploy (push) Failing after 3m33s

This commit is contained in:
2025-08-26 14:12:49 +03:00
parent 2a6fcc3f45
commit 90aece7a60
11 changed files with 253 additions and 194 deletions

View File

@@ -44,9 +44,9 @@ def session():
class TestCommunityRoleInheritance:
"""Тесты наследования ролей в сообществах"""
def test_community_author_role_inheritance(self, session, unique_email, unique_slug):
@pytest.mark.asyncio
async def test_community_author_role_inheritance(self, session, unique_email, unique_slug):
"""Тест наследования ролей в CommunityAuthor"""
pytest.skip("Community RBAC тесты временно отключены из-за проблем с Redis")
# Создаем тестового пользователя
user = Author(
email=unique_email,
@@ -70,7 +70,7 @@ class TestCommunityRoleInheritance:
session.flush()
# Инициализируем разрешения для сообщества
initialize_community_permissions(community.id)
await initialize_community_permissions(community.id)
# Создаем CommunityAuthor с ролью author
ca = CommunityAuthor(
@@ -84,13 +84,13 @@ class TestCommunityRoleInheritance:
# Проверяем что author наследует разрешения reader
reader_permissions = ["shout:read", "topic:read", "collection:read", "chat:read"]
for perm in reader_permissions:
has_permission = user_has_permission(user.id, perm, community.id)
has_permission = await user_has_permission(user.id, perm, community.id)
assert has_permission, f"Author должен наследовать разрешение {perm} от reader"
# Проверяем специфичные разрешения author
author_permissions = ["draft:create", "shout:create", "collection:create", "invite:create"]
for perm in author_permissions:
has_permission = user_has_permission(user.id, perm, community.id)
has_permission = await user_has_permission(user.id, perm, community.id)
assert has_permission, f"Author должен иметь разрешение {perm}"
def test_community_editor_role_inheritance(self, session, unique_email, unique_slug):