Corp/backend/pytest.ini
igor_nadein ad8208789f feat: add LDAP testing infrastructure
- Add LDAP docker container structure (01-base-structure.ldif)
- Add .env.test with LDAP configuration for tests
- Create tests/ldap_fixtures.py with LDAP-specific fixtures
- Create tests/api/v1/employees/test_helpers.py with centralized helpers
- Add LDAP markers to pytest.ini (ldap_required, ldap_optional)
- Add comprehensive LDAP testing documentation
- Fix test_department_head_rights.py to use centralized helpers

New fixtures:
- ldap_available: checks if LDAP server is accessible
- ldap_config: returns LDAP configuration
- ensure_ldap_enabled/disabled: force LDAP state for test
- ldap_cleanup: auto-cleanup LDAP entries after test

New helpers:
- make_user(): centralized user creation
- grant_permission(): permission assignment
- make_department/position/role(): entity creation
- extract_results(): paginated response helper

Infrastructure:
- OU=Users, OU=Departments, OU=Groups, OU=Positions, OU=Dismissed
- Test groups: Developers, Managers
- Test departments: IT, HR
2026-02-16 17:31:48 +03:00

29 lines
1017 B
INI
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[pytest]
DJANGO_SETTINGS_MODULE = eusrr_backend.settings
python_files = tests.py test_*.py *_tests.py
# Asyncio mode
asyncio_mode = auto
asyncio_default_fixture_loop_scope = function
# Markers для категоризации тестов
markers =
manual: marks tests as manual (not run by default)
integration: marks tests as integration tests
slow: marks tests as slow running
asyncio: marks tests as asynchronous tests
ldap_required: тест требует работающий LDAP сервер
ldap_optional: тест может работать с LDAP и без него (параметризован)
# Исключить manual tests по умолчанию
addopts = -m "not manual" --strict-markers
# Пути для сбора тестов
testpaths = tests employees
# Игнорировать директории
norecursedirs = .git .venv __pycache__ node_modules staticfiles media scripts tests/manual
# Опции для вывода
console_output_style = progress