============================= test session starts ============================= platform win32 -- Python 3.12.6, pytest-8.4.1, pluggy-1.6.0 -- C:\Users\igor_\Dev\EUSRR\.venv\Scripts\python.exe cachedir: .pytest_cache django: version: 5.2.4, settings: eusrr_backend.settings (from ini) rootdir: C:\Users\igor_\Dev\EUSRR\backend configfile: pytest.ini plugins: anyio-4.12.0, asyncio-1.3.0, django-4.11.1 asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=function, asyncio_default_test_loop_scope=function collecting ... collected 150 items tests/api/v1/employees/test_department_head_rights.py::test_head_can_update_department_without_explicit_role_perms FAILED [ 0%] tests/api/v1/employees/test_department_head_rights.py::test_head_can_set_member_role_and_non_head_cannot FAILED [ 1%] tests/api/v1/employees/test_department_head_rights.py::test_head_can_change_head_and_loses_rights_afterwards FAILED [ 2%] tests/api/v1/employees/test_department_membership_separation.py::test_add_member_requires_manage_and_does_not_assign_role FAILED [ 2%] tests/api/v1/employees/test_department_membership_separation.py::test_all_three_actions_require_auth_and_permissions FAILED [ 3%] tests/api/v1/employees/test_department_membership_separation.py::test_set_member_role_requires_assign_not_manage FAILED [ 4%] tests/api/v1/employees/test_department_membership_separation.py::test_set_member_role_does_not_create_membership_and_does_not_toggle_active FAILED [ 4%] tests/api/v1/employees/test_department_membership_separation.py::test_add_member_ignores_role_parameter FAILED [ 5%] tests/api/v1/employees/test_department_membership_separation.py::test_remove_member_requires_manage_and_does_not_touch_role FAILED [ 6%] tests/api/v1/employees/test_department_roles.py::test_list_filtered_by_department FAILED [ 6%] tests/api/v1/employees/test_department_roles.py::test_create_requires_assign_department_role FAILED [ 7%] tests/api/v1/employees/test_department_roles.py::test_update_and_destroy_scope_enforced FAILED [ 8%] tests/api/v1/employees/test_department_roles.py::test_perm_choices_and_perms_and_set_perms FAILED [ 8%] tests/api/v1/employees/test_department_roles.py::test_set_perms_validates_payload FAILED [ 9%] tests/api/v1/employees/test_department_roles.py::test_back_compat_permissions_field_contains_ids FAILED [ 10%] tests/api/v1/employees/test_department_roles.py::test_create_with_scoped_permission_codes_and_update_name FAILED [ 10%] tests/api/v1/employees/test_department_roles.py::test_cross_department_access_denied_for_set_perms FAILED [ 11%] tests/api/v1/employees/test_department_roles_extra.py::test_unauth_cannot_list_or_get PASSED [ 12%] tests/api/v1/employees/test_department_roles_extra.py::test_read_only_allowed_without_assign FAILED [ 12%] tests/api/v1/employees/test_department_roles_extra.py::test_staff_override_for_write FAILED [ 13%] tests/api/v1/employees/test_department_roles_extra.py::test_ordering_stable_by_name_then_id FAILED [ 14%] tests/api/v1/employees/test_department_roles_extra.py::test_set_perms_ids_take_precedence_over_codes FAILED [ 14%] tests/api/v1/employees/test_department_roles_extra.py::test_serializer_codes_override_scoped_permissions_on_create FAILED [ 15%] tests/api/v1/employees/test_department_roles_extra.py::test_perm_choices_fields_and_nonempty FAILED [ 16%] tests/api/v1/employees/test_department_roles_extra.py::test_destroy_requires_assign_in_same_department FAILED [ 16%] tests/api/v1/employees/test_department_roles_extra.py::test_set_perms_dedup_and_replace_semantics FAILED [ 17%] tests/api/v1/employees/test_departments.py::test_list_requires_auth PASSED [ 18%] tests/api/v1/employees/test_departments.py::test_list_ok_for_authenticated FAILED [ 18%] tests/api/v1/employees/test_departments.py::test_search_and_ordering FAILED [ 19%] tests/api/v1/employees/test_departments.py::test_employees_count_adds_head_if_not_in_links FAILED [ 20%] tests/api/v1/employees/test_departments.py::test_employees_count_not_double_count_head_if_in_links FAILED [ 20%] tests/api/v1/employees/test_departments.py::test_create_requires_staff FAILED [ 21%] tests/api/v1/employees/test_departments.py::test_destroy_requires_staff FAILED [ 22%] tests/api/v1/employees/test_departments.py::test_partial_update_name_requires_manage_perm FAILED [ 22%] tests/api/v1/employees/test_departments.py::test_partial_update_head_requires_change_head_perm FAILED [ 23%] tests/api/v1/employees/test_departments.py::test_partial_update_head_same_value_does_not_require_extra_perm FAILED [ 24%] tests/api/v1/employees/test_departments.py::test_set_head_by_role_with_perm FAILED [ 24%] tests/api/v1/employees/test_departments.py::test_set_head_validation_inactive_employee FAILED [ 25%] tests/api/v1/employees/test_departments.py::test_set_head_remove_with_null FAILED [ 26%] tests/api/v1/employees/test_departments.py::test_set_head_requires_perm FAILED [ 26%] tests/api/v1/employees/test_departments.py::test_set_member_role_happy_path FAILED [ 27%] tests/api/v1/employees/test_departments.py::test_set_member_role_reject_foreign_role FAILED [ 28%] tests/api/v1/employees/test_departments.py::test_set_member_role_requires_perm FAILED [ 28%] tests/api/v1/employees/test_departments.py::test_set_member_role_missing_employee_id FAILED [ 29%] tests/api/v1/employees/test_email_verification_security.py::TestEmailChangeResetsVerification::test_change_email_resets_email_verified_for_self FAILED [ 30%] tests/api/v1/employees/test_email_verification_security.py::TestEmailChangeResetsVerification::test_change_email_via_me_endpoint_resets_verification FAILED [ 30%] tests/api/v1/employees/test_email_verification_security.py::TestEmailChangeResetsVerification::test_change_email_sends_verification_code FAILED [ 31%] tests/api/v1/employees/test_email_verification_security.py::TestEmailChangeResetsVerification::test_change_other_fields_does_not_reset_verification FAILED [ 32%] tests/api/v1/employees/test_email_verification_security.py::TestEmailChangeResetsVerification::test_change_email_to_same_value_does_not_reset FAILED [ 32%] tests/api/v1/employees/test_email_verification_security.py::TestUnverifiedUserRestrictions::test_unverified_user_cannot_create_department SKIPPED [ 33%] tests/api/v1/employees/test_email_verification_security.py::TestUnverifiedUserRestrictions::test_unverified_user_cannot_update_other_employee SKIPPED [ 34%] tests/api/v1/employees/test_email_verification_security.py::TestUnverifiedUserRestrictions::test_unverified_user_can_update_self_non_critical_fields FAILED [ 34%] tests/api/v1/employees/test_email_verification_security.py::TestUnverifiedUserRestrictions::test_unverified_user_can_verify_email FAILED [ 35%] tests/api/v1/employees/test_email_verification_security.py::TestUnverifiedUserRestrictions::test_unverified_user_can_resend_code FAILED [ 36%] tests/api/v1/employees/test_email_verification_security.py::TestResendEmailLogic::test_resend_email_generates_new_code FAILED [ 36%] tests/api/v1/employees/test_email_verification_security.py::TestResendEmailLogic::test_resend_email_to_verified_user_fails FAILED [ 37%] tests/api/v1/employees/test_email_verification_security.py::TestResendEmailLogic::test_resend_email_to_nonexistent_user_fails PASSED [ 38%] tests/api/v1/employees/test_email_verification_security.py::TestResendEmailLogic::test_old_code_becomes_invalid_after_resend FAILED [ 38%] tests/api/v1/employees/test_email_verification_security.py::TestStaffCanBypassRestrictions::test_admin_created_user_is_verified_by_default SKIPPED [ 39%] tests/api/v1/employees/test_email_verification_security.py::TestStaffCanBypassRestrictions::test_superuser_is_verified_by_default PASSED [ 40%] tests/api/v1/employees/test_email_verification_security.py::TestEmailVerificationWorkflow::test_full_registration_and_verification_flow FAILED [ 40%] tests/api/v1/employees/test_email_verification_security.py::TestEmailVerificationWorkflow::test_change_email_and_verify_new_one FAILED [ 41%] tests/api/v1/employees/test_employee_actions.py::test_list_requires_auth_and_filtering PASSED [ 42%] tests/api/v1/employees/test_employee_actions.py::test_create_requires_perm_or_staff PASSED [ 42%] tests/api/v1/employees/test_employee_actions.py::test_dismissal_deactivates_employee_and_links PASSED [ 43%] tests/api/v1/employees/test_employee_actions.py::test_non_dismissal_activates_employee PASSED [ 44%] tests/api/v1/employees/test_employee_actions.py::test_update_to_dismissed_applies_effects PASSED [ 44%] tests/api/v1/employees/test_employee_actions.py::test_delete_requires_perm_or_staff PASSED [ 45%] tests/api/v1/employees/test_employee_actions.py::test_dismissal_syncs_to_ldap_if_has_dn PASSED [ 46%] tests/api/v1/employees/test_employee_actions.py::test_dismissal_handles_ldap_error_gracefully PASSED [ 46%] tests/api/v1/employees/test_employee_actions.py::test_non_dismissal_syncs_activation_to_ldap PASSED [ 47%] tests/api/v1/employees/test_employee_actions.py::test_dismissal_skips_ldap_if_no_dn PASSED [ 48%] tests/api/v1/employees/test_employee_actions.py::test_dismissal_works_when_ldap_disabled FAILED [ 48%] tests/api/v1/employees/test_employee_actions.py::test_dismissal_moves_to_dismissed_ou PASSED [ 49%] tests/api/v1/employees/test_employee_actions.py::test_restoration_moves_from_dismissed_to_users FAILED [ 50%] tests/api/v1/employees/test_employee_actions.py::test_dismissal_without_department_moves_to_dismissed PASSED [ 50%] tests/api/v1/employees/test_employees.py::test_list_requires_auth PASSED [ 51%] tests/api/v1/employees/test_employees.py::test_list_ok_for_authenticated PASSED [ 52%] tests/api/v1/employees/test_employees.py::test_retrieve_requires_auth PASSED [ 52%] tests/api/v1/employees/test_employees.py::test_retrieve_ok PASSED [ 53%] tests/api/v1/employees/test_employees.py::test_search_by_email_and_last_name PASSED [ 54%] tests/api/v1/employees/test_employees.py::test_filter_by_department_includes_members_and_head PASSED [ 54%] tests/api/v1/employees/test_employees.py::test_filter_by_position PASSED [ 55%] tests/api/v1/employees/test_employees.py::test_filter_by_skills_any_of PASSED [ 56%] tests/api/v1/employees/test_employees.py::test_filter_by_email_verified_and_active PASSED [ 56%] tests/api/v1/employees/test_employees.py::test_filter_actually_active_logic PASSED [ 57%] tests/api/v1/employees/test_employees.py::test_create_requires_staff FAILED [ 58%] tests/api/v1/employees/test_employees.py::test_partial_update_self_allowed PASSED [ 58%] tests/api/v1/employees/test_employees.py::test_partial_update_other_forbidden_for_regular_user PASSED [ 59%] tests/api/v1/employees/test_employees.py::test_partial_update_other_allowed_for_staff PASSED [ 60%] tests/api/v1/employees/test_employees.py::test_destroy_requires_admin FAILED [ 60%] tests/api/v1/employees/test_employees.py::test_me_get_returns_current_user PASSED [ 61%] tests/api/v1/employees/test_employees.py::test_me_patch_updates_profile PASSED [ 62%] tests/api/v1/employees/test_employees.py::test_me_patch_rejects_when_all_contacts_empty FAILED [ 62%] tests/api/v1/employees/test_employees_fields_in_list.py::test_list_includes_basic_fields FAILED [ 63%] tests/api/v1/employees/test_employees_fields_in_list.py::test_list_departments_include_role FAILED [ 64%] tests/api/v1/employees/test_ldap_optional_departments.py::test_department_list_accessible_without_ldap PASSED [ 64%] tests/api/v1/employees/test_ldap_optional_departments.py::test_retrieve_department_without_ldap PASSED [ 65%] tests/api/v1/employees/test_ldap_optional_groups.py::test_create_group_with_ldap SKIPPED [ 66%] tests/api/v1/employees/test_ldap_optional_groups.py::test_create_group_without_ldap ERROR [ 66%] tests/api/v1/employees/test_ldap_optional_groups.py::test_add_members_with_ldap SKIPPED [ 67%] tests/api/v1/employees/test_ldap_optional_groups.py::test_add_members_without_ldap ERROR [ 68%] tests/api/v1/employees/test_ldap_optional_groups.py::test_destroy_group_with_ldap SKIPPED [ 68%] tests/api/v1/employees/test_ldap_optional_groups.py::test_destroy_group_without_ldap ERROR [ 69%] tests/api/v1/employees/test_ldap_optional_groups.py::test_get_members_with_ldap SKIPPED [ 70%] tests/api/v1/employees/test_ldap_optional_groups.py::test_get_members_without_ldap ERROR [ 70%] tests/api/v1/employees/test_ldap_optional_helpers.py::test_is_ldap_enabled_returns_true_when_enabled PASSED [ 71%] tests/api/v1/employees/test_ldap_optional_helpers.py::test_is_ldap_enabled_returns_false_when_disabled PASSED [ 72%] tests/api/v1/employees/test_ldap_optional_helpers.py::test_is_ldap_enabled_returns_false_when_not_set PASSED [ 72%] tests/api/v1/employees/test_ldap_optional_helpers.py::test_ldap_try_success_with_ldap_enabled PASSED [ 73%] tests/api/v1/employees/test_ldap_optional_helpers.py::test_ldap_try_ldap_error_returns_502 PASSED [ 74%] tests/api/v1/employees/test_ldap_optional_helpers.py::test_ldap_try_skips_when_ldap_disabled PASSED [ 74%] tests/api/v1/employees/test_ldap_optional_helpers.py::test_ldap_try_service_error_returns_502 PASSED [ 75%] tests/api/v1/employees/test_ldap_optional_helpers.py::test_ldap_try_db_error_returns_502 PASSED [ 76%] tests/api/v1/employees/test_ldap_optional_register.py::test_register_with_ldap_creates_user_in_ldap_and_db SKIPPED [ 76%] tests/api/v1/employees/test_ldap_optional_register.py::test_register_with_ldap_duplicate_email_returns_400 SKIPPED [ 77%] tests/api/v1/employees/test_ldap_optional_register.py::test_register_without_ldap_creates_user_only_in_db FAILED [ 78%] tests/api/v1/employees/test_ldap_optional_register.py::test_register_without_ldap_duplicate_email_returns_400 PASSED [ 78%] tests/api/v1/employees/test_ldap_optional_register.py::test_register_validates_required_fields[with_ldap] SKIPPED [ 79%] tests/api/v1/employees/test_ldap_optional_register.py::test_register_validates_required_fields[without_ldap] SKIPPED [ 80%] tests/api/v1/employees/test_ldap_optional_verify_email.py::test_verify_email_with_ldap_activates_user_in_ldap_and_db SKIPPED [ 80%] tests/api/v1/employees/test_ldap_optional_verify_email.py::test_verify_email_without_ldap_activates_user_only_in_db PASSED [ 81%] tests/api/v1/employees/test_ldap_optional_verify_email.py::test_verify_email_with_wrong_code_returns_400_without_ldap PASSED [ 82%] tests/api/v1/employees/test_ldap_optional_verify_email.py::test_verify_email_already_verified_returns_400_without_ldap PASSED [ 82%] tests/api/v1/employees/test_ldap_optional_verify_email.py::test_verify_email_nonexistent_user_returns_404_without_ldap PASSED [ 83%] tests/api/v1/employees/test_ldap_optional_verify_email.py::test_verify_email_empty_code_returns_400_without_ldap PASSED [ 84%] tests/api/v1/employees/test_ldap_optional_verify_email.py::test_verify_email_ldap_error_returns_502 SKIPPED [ 84%] tests/api/v1/employees/test_positions.py::test_list_requires_auth PASSED [ 85%] tests/api/v1/employees/test_positions.py::test_create_permissions FAILED [ 86%] tests/api/v1/employees/test_positions.py::test_update_permissions_and_search_ordering FAILED [ 86%] tests/api/v1/employees/test_positions.py::test_delete_permissions PASSED [ 87%] tests/api/v1/employees/test_positions.py::test_set_groups_requires_special_perm FAILED [ 88%] tests/api/v1/employees/test_positions.py::test_add_and_remove_groups_and_permissions_endpoint FAILED [ 88%] tests/api/v1/employees/test_positions.py::test_groups_payload_validation PASSED [ 89%] tests/api/v1/employees/test_role_assignment.py::TestRoleAssignmentEndpoints::test_assign_role_to_any_employee FAILED [ 90%] tests/api/v1/employees/test_role_assignment.py::TestRoleAssignmentEndpoints::test_revoke_role FAILED [ 90%] tests/api/v1/employees/test_role_assignment.py::TestRoleAssignmentEndpoints::test_assignments_list FAILED [ 91%] tests/api/v1/employees/test_role_assignment.py::TestRoleAssignmentEndpoints::test_assign_requires_permission FAILED [ 92%] tests/api/v1/employees/test_role_assignment.py::TestRoleAssignmentEndpoints::test_assign_with_dept_permission FAILED [ 92%] tests/api/v1/employees/test_role_assignment.py::TestRoleAssignmentPermissions::test_permission_check_via_role_assignment FAILED [ 93%] tests/api/v1/employees/test_role_assignment.py::TestRoleAssignmentPermissions::test_inactive_assignment_does_not_grant_permission FAILED [ 94%] tests/api/v1/employees/test_skills.py::test_list_search_ordering_requires_auth PASSED [ 94%] tests/api/v1/employees/test_skills.py::test_create_allowed_for_regular_user PASSED [ 95%] tests/api/v1/employees/test_skills.py::test_update_delete_permissions PASSED [ 96%] tests/api/v1/employees/test_skills.py::test_staff_bypasses_permissions PASSED [ 96%] tests/api/v1/employees/test_skills.py::test_bulk_create_by_regular_user PASSED [ 97%] tests/api/v1/employees/test_skills.py::test_merge_requires_perm_and_reassigns PASSED [ 98%] tests/api/v1/employees/test_skills.py::test_merge_same_id_and_invalid_ids PASSED [ 98%] tests/api/v1/employees/test_skills.py::test_merge_without_reassign_or_delete PASSED [ 99%] tests/api/v1/employees/test_skills.py::test_merge_idempotent_if_employee_already_has_target PASSED [100%] =================================== ERRORS ==================================== ______________ ERROR at setup of test_create_group_without_ldap _______________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _______________ ERROR at setup of test_add_members_without_ldap _______________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly ______________ ERROR at setup of test_destroy_group_without_ldap ______________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _______________ ERROR at setup of test_get_members_without_ldap _______________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly ================================== FAILURES =================================== _________ test_head_can_update_department_without_explicit_role_perms _________ employees\ldap\services\department_service.py:136: in update_department current_dn = self._get_department_dn(dept) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\services\department_service.py:981: in _get_department_dn raise DirectoryServiceError( E employees.ldap.errors.DirectoryServiceError: Department has no ldap_dn in sync state The above exception was the direct cause of the following exception: tests\api\v1\employees\test_department_head_rights.py:97: in test_head_can_update_department_without_explicit_role_perms resp = api_client.patch(url, {"description": "new"}, format="json") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:315: in patch response = super().patch( ..\.venv\Lib\site-packages\rest_framework\test.py:221: in patch return self.generic('PATCH', path, data, content_type, **extra) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:237: in generic return super().generic( ..\.venv\Lib\site-packages\django\test\client.py:671: in generic return self.request(**r) ^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:289: in request return super().request(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:241: in request request = super().request(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\django\test\client.py:1087: in request self.check_exception(response) ..\.venv\Lib\site-packages\django\test\client.py:802: in check_exception raise exc_value ..\.venv\Lib\site-packages\django\core\handlers\exception.py:55: in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\django\core\handlers\base.py:197: in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\django\views\decorators\csrf.py:65: in _view_wrapper return view_func(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\viewsets.py:125: in view return self.dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\views.py:515: in dispatch response = self.handle_exception(exc) ^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\views.py:475: in handle_exception self.raise_uncaught_exception(exc) ..\.venv\Lib\site-packages\rest_framework\views.py:486: in raise_uncaught_exception raise exc ..\.venv\Lib\site-packages\rest_framework\views.py:512: in dispatch response = handler(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api\v1\employees\views\departments.py:269: in partial_update instance = svc.update_department(instance, changes) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\directory_service.py:218: in update_department return self._department_service.update_department(dept, changes) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\services\department_service.py:138: in update_department raise DirectoryServiceError( E employees.ldap.errors.DirectoryServiceError: Не найден DN отдела (sync state): Department has no ldap_dn in sync state ---------------------------- Captured stderr setup ---------------------------- Creating test database for alias 'default'... ---------------------------- Captured stderr call ----------------------------- [ERROR] 2026-02-16 17:34:50,458 django.request:253 Internal Server Error: /api/v1/departments/1/ Traceback (most recent call last): File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\department_service.py", line 136, in update_department current_dn = self._get_department_dn(dept) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\department_service.py", line 981, in _get_department_dn raise DirectoryServiceError( employees.ldap.errors.DirectoryServiceError: Department has no ldap_dn in sync state The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\django\views\decorators\csrf.py", line 65, in _view_wrapper return view_func(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\viewsets.py", line 125, in view return self.dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 515, in dispatch response = self.handle_exception(exc) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 475, in handle_exception self.raise_uncaught_exception(exc) File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 486, in raise_uncaught_exception raise exc File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 512, in dispatch response = handler(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\api\v1\employees\views\departments.py", line 269, in partial_update instance = svc.update_department(instance, changes) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\directory_service.py", line 218, in update_department return self._department_service.update_department(dept, changes) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\department_service.py", line 138, in update_department raise DirectoryServiceError( employees.ldap.errors.DirectoryServiceError: Не найден DN отдела (sync state): Department has no ldap_dn in sync state ______________ test_head_can_set_member_role_and_non_head_cannot ______________ tests\api\v1\employees\test_department_head_rights.py:118: in test_head_can_set_member_role_and_non_head_cannot assert resp.status_code == status.HTTP_200_OK E assert 502 == 200 E + where 502 = .status_code E + and 200 = status.HTTP_200_OK ---------------------------- Captured stderr call ----------------------------- [ERROR] 2026-02-16 17:34:50,809 django.request:253 Bad Gateway: /api/v1/departments/2/set_member_role/ ____________ test_head_can_change_head_and_loses_rights_afterwards ____________ tests\api\v1\employees\test_department_head_rights.py:143: in test_head_can_change_head_and_loses_rights_afterwards assert resp.status_code == status.HTTP_200_OK E assert 400 == 200 E + where 400 = .status_code E + and 200 = status.HTTP_200_OK ---------------------------- Captured stderr call ----------------------------- [WARNING] 2026-02-16 17:34:50,890 django.request:253 Bad Request: /api/v1/departments/3/set_head/ __________ test_add_member_requires_manage_and_does_not_assign_role ___________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _____________ test_all_three_actions_require_auth_and_permissions _____________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _______________ test_set_member_role_requires_assign_not_manage _______________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _ test_set_member_role_does_not_create_membership_and_does_not_toggle_active __ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly ___________________ test_add_member_ignores_role_parameter ____________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _________ test_remove_member_requires_manage_and_does_not_touch_role __________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly ______________________ test_list_filtered_by_department _______________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _________________ test_create_requires_assign_department_role _________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly ___________________ test_update_and_destroy_scope_enforced ____________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly __________________ test_perm_choices_and_perms_and_set_perms __________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly ______________________ test_set_perms_validates_payload _______________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _______________ test_back_compat_permissions_field_contains_ids _______________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly __________ test_create_with_scoped_permission_codes_and_update_name ___________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly ______________ test_cross_department_access_denied_for_set_perms ______________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly ____________________ test_read_only_allowed_without_assign ____________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly ________________________ test_staff_override_for_write ________________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly ____________________ test_ordering_stable_by_name_then_id _____________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly ________________ test_set_perms_ids_take_precedence_over_codes ________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _________ test_serializer_codes_override_scoped_permissions_on_create _________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly ____________________ test_perm_choices_fields_and_nonempty ____________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _______________ test_destroy_requires_assign_in_same_department _______________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _________________ test_set_perms_dedup_and_replace_semantics __________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _______________________ test_list_ok_for_authenticated ________________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly __________________________ test_search_and_ordering ___________________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _______________ test_employees_count_adds_head_if_not_in_links ________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly ___________ test_employees_count_not_double_count_head_if_in_links ____________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _________________________ test_create_requires_staff __________________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _________________________ test_destroy_requires_staff _________________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly ________________ test_partial_update_name_requires_manage_perm ________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _____________ test_partial_update_head_requires_change_head_perm ______________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _______ test_partial_update_head_same_value_does_not_require_extra_perm _______ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _______________________ test_set_head_by_role_with_perm _______________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _________________ test_set_head_validation_inactive_employee __________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _______________________ test_set_head_remove_with_null ________________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _________________________ test_set_head_requires_perm _________________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _______________________ test_set_member_role_happy_path _______________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly __________________ test_set_member_role_reject_foreign_role ___________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _____________________ test_set_member_role_requires_perm ______________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly __________________ test_set_member_role_missing_employee_id ___________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _ TestEmailChangeResetsVerification.test_change_email_resets_email_verified_for_self _ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _ TestEmailChangeResetsVerification.test_change_email_via_me_endpoint_resets_verification _ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _ TestEmailChangeResetsVerification.test_change_email_sends_verification_code _ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _ TestEmailChangeResetsVerification.test_change_other_fields_does_not_reset_verification _ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _ TestEmailChangeResetsVerification.test_change_email_to_same_value_does_not_reset _ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _ TestUnverifiedUserRestrictions.test_unverified_user_can_update_self_non_critical_fields _ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly ____ TestUnverifiedUserRestrictions.test_unverified_user_can_verify_email _____ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _____ TestUnverifiedUserRestrictions.test_unverified_user_can_resend_code _____ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly __________ TestResendEmailLogic.test_resend_email_generates_new_code __________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly ________ TestResendEmailLogic.test_resend_email_to_verified_user_fails ________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _______ TestResendEmailLogic.test_old_code_becomes_invalid_after_resend _______ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _ TestEmailVerificationWorkflow.test_full_registration_and_verification_flow __ tests\api\v1\employees\test_email_verification_security.py:430: in test_full_registration_and_verification_flow assert response.status_code in [ E assert 400 in [201, 502] E + where 400 = .status_code ---------------------------- Captured stderr call ----------------------------- [WARNING] 2026-02-16 17:34:51,498 django.request:253 Bad Request: /api/v1/auth/register/ ------------------------------ Captured log call ------------------------------ WARNING api.v1.employees.views.auth:auth.py:161 [REGISTER] Received data: {'email': 'newuser@test.com', 'password': 'TestPass123!', 'password_confirmation': 'TestPass123!', 'first_name': 'New', 'last_name': 'User', 'telegram': '@newuser', 'birth_date': '1990-01-01', 'phone_number': '+79001234569'} WARNING api.v1.employees.views.auth:auth.py:162 [REGISTER] Content-Type: application/json WARNING api.v1.employees.views.auth:auth.py:180 [REGISTER] Validation errors: {'avatar': [ErrorDetail(string='Ни одного файла не было отправлено.', code='required')], 'gender': [ErrorDetail(string='Поле "Пол" обязательно для заполнения.', code='required')]} _____ TestEmailVerificationWorkflow.test_change_email_and_verify_new_one ______ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly ___________________ test_dismissal_works_when_ldap_disabled ___________________ tests\api\v1\employees\test_employee_actions.py:430: in test_dismissal_works_when_ldap_disabled mock_update.assert_not_called() ..\..\..\AppData\Local\Programs\Python\Python312\Lib\unittest\mock.py:908: in assert_not_called raise AssertionError(msg) E AssertionError: Expected 'update_user' to not have been called. Called 1 times. E Calls: [call(, changes={'is_active': False})]. ------------------------------ Captured log call ------------------------------ ERROR api.v1.employees.views.actions:actions.py:154 Failed to move dismissed employee: LDAP move user to base failed: {'result': 53, 'description': 'unwillingToPerform', 'dn': '', 'message': 'no global superior knowledge', 'referrals': None, 'type': 'modDNResponse'} _______________ test_restoration_moves_from_dismissed_to_users ________________ tests\api\v1\employees\test_employee_actions.py:515: in test_restoration_moves_from_dismissed_to_users emp = _user(is_active=False) # Уволенный сотрудник ^^^^^^^^^^^^^^^^^^^^^^ E TypeError: _user() got an unexpected keyword argument 'is_active' _________________________ test_create_requires_staff __________________________ tests\api\v1\employees\test_employees.py:286: in test_create_requires_staff assert resp.status_code == status.HTTP_400_BAD_REQUEST E assert 201 == 400 E + where 201 = .status_code E + and 400 = status.HTTP_400_BAD_REQUEST ---------------------------- Captured stderr call ----------------------------- [WARNING] 2026-02-16 17:34:53,338 django.request:253 Forbidden: /api/v1/employees/ _________________________ test_destroy_requires_admin _________________________ employees\ldap\services\user_service.py:190: in delete_user_in_ldap_only dn = self._get_employee_dn(instance) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\services\user_service.py:855: in _get_employee_dn raise DirectoryServiceError("Employee has no ldap_dn") E employees.ldap.errors.DirectoryServiceError: Employee has no ldap_dn During handling of the above exception, another exception occurred: common\external_sync_mixin.py:188: in _perform_with_sync_instance sync_method(**external_data) employees\ldap\directory_service.py:133: in delete_user_in_ldap_only return self._user_service.delete_user_in_ldap_only(instance) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\services\user_service.py:193: in delete_user_in_ldap_only logger.warning( ^^^^^^ E NameError: name 'logger' is not defined During handling of the above exception, another exception occurred: tests\api\v1\employees\test_employees.py:346: in test_destroy_requires_admin resp = api_client.delete(url) ^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:323: in delete response = super().delete( ..\.venv\Lib\site-packages\rest_framework\test.py:225: in delete return self.generic('DELETE', path, data, content_type, **extra) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:237: in generic return super().generic( ..\.venv\Lib\site-packages\django\test\client.py:671: in generic return self.request(**r) ^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:289: in request return super().request(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:241: in request request = super().request(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\django\test\client.py:1087: in request self.check_exception(response) ..\.venv\Lib\site-packages\django\test\client.py:802: in check_exception raise exc_value ..\.venv\Lib\site-packages\django\core\handlers\exception.py:55: in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\django\core\handlers\base.py:197: in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\django\views\decorators\csrf.py:65: in _view_wrapper return view_func(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\viewsets.py:125: in view return self.dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\views.py:515: in dispatch response = self.handle_exception(exc) ^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\views.py:475: in handle_exception self.raise_uncaught_exception(exc) ..\.venv\Lib\site-packages\rest_framework\views.py:486: in raise_uncaught_exception raise exc ..\.venv\Lib\site-packages\rest_framework\views.py:512: in dispatch response = handler(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\mixins.py:91: in destroy self.perform_destroy(instance) common\external_sync_mixin.py:103: in perform_destroy return self._perform_with_sync_instance(instance, 'destroy', super().perform_destroy) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ common\external_sync_mixin.py:201: in _perform_with_sync_instance raise ExternalSyncError(error_response) E common.external_sync_mixin.ExternalSyncError ---------------------------- Captured stderr call ----------------------------- [WARNING] 2026-02-16 17:34:53,602 django.request:253 Forbidden: /api/v1/employees/74/ [ERROR] 2026-02-16 17:34:53,681 common.external_sync_mixin:195 External sync failed, rolling back: name 'logger' is not defined [ERROR] 2026-02-16 17:34:53,684 django.request:253 Internal Server Error: /api/v1/employees/74/ Traceback (most recent call last): File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\user_service.py", line 190, in delete_user_in_ldap_only dn = self._get_employee_dn(instance) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\user_service.py", line 855, in _get_employee_dn raise DirectoryServiceError("Employee has no ldap_dn") employees.ldap.errors.DirectoryServiceError: Employee has no ldap_dn During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\igor_\Dev\EUSRR\backend\common\external_sync_mixin.py", line 188, in _perform_with_sync_instance sync_method(**external_data) File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\directory_service.py", line 133, in delete_user_in_ldap_only return self._user_service.delete_user_in_ldap_only(instance) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\user_service.py", line 193, in delete_user_in_ldap_only logger.warning( ^^^^^^ NameError: name 'logger' is not defined During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\django\views\decorators\csrf.py", line 65, in _view_wrapper return view_func(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\viewsets.py", line 125, in view return self.dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 515, in dispatch response = self.handle_exception(exc) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 475, in handle_exception self.raise_uncaught_exception(exc) File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 486, in raise_uncaught_exception raise exc File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 512, in dispatch response = handler(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\mixins.py", line 91, in destroy self.perform_destroy(instance) File "C:\Users\igor_\Dev\EUSRR\backend\common\external_sync_mixin.py", line 103, in perform_destroy return self._perform_with_sync_instance(instance, 'destroy', super().perform_destroy) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\common\external_sync_mixin.py", line 201, in _perform_with_sync_instance raise ExternalSyncError(error_response) common.external_sync_mixin.ExternalSyncError ------------------------------ Captured log call ------------------------------ ERROR api.v1.employees.views.employees:employees.py:193 LDAP sync failed for destroy on Employee None: name 'logger' is not defined Traceback (most recent call last): File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\user_service.py", line 190, in delete_user_in_ldap_only dn = self._get_employee_dn(instance) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\user_service.py", line 855, in _get_employee_dn raise DirectoryServiceError("Employee has no ldap_dn") employees.ldap.errors.DirectoryServiceError: Employee has no ldap_dn During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\igor_\Dev\EUSRR\backend\common\external_sync_mixin.py", line 188, in _perform_with_sync_instance sync_method(**external_data) File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\directory_service.py", line 133, in delete_user_in_ldap_only return self._user_service.delete_user_in_ldap_only(instance) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\user_service.py", line 193, in delete_user_in_ldap_only logger.warning( ^^^^^^ NameError: name 'logger' is not defined ________________ test_me_patch_rejects_when_all_contacts_empty ________________ tests\api\v1\employees\test_employees.py:385: in test_me_patch_rejects_when_all_contacts_empty assert r.status_code == status.HTTP_400_BAD_REQUEST E assert 200 == 400 E + where 200 = .status_code E + and 400 = status.HTTP_400_BAD_REQUEST _______________________ test_list_includes_basic_fields _______________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _____________________ test_list_departments_include_role ______________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _____________ test_register_without_ldap_creates_user_only_in_db ______________ tests\api\v1\employees\test_ldap_optional_register.py:120: in test_register_without_ldap_creates_user_only_in_db assert response.status_code == status.HTTP_201_CREATED E assert 400 == 201 E + where 400 = .status_code E + and 201 = status.HTTP_201_CREATED ---------------------------- Captured stderr call ----------------------------- [WARNING] 2026-02-16 17:34:54,064 django.request:253 Bad Request: /api/v1/auth/register/ ------------------------------ Captured log call ------------------------------ WARNING api.v1.employees.views.auth:auth.py:161 [REGISTER] Received data: {'email': 'test4000@example.com', 'first_name': 'Test', 'last_name': 'User', 'phone_number': '+79990001000', 'password': 'SecurePass123!', 'whatsapp': '+79990001001', 'birth_date': '1990-01-01'} WARNING api.v1.employees.views.auth:auth.py:162 [REGISTER] Content-Type: application/json WARNING api.v1.employees.views.auth:auth.py:180 [REGISTER] Validation errors: {'avatar': [ErrorDetail(string='Ни одного файла не было отправлено.', code='required')], 'gender': [ErrorDetail(string='Поле "Пол" обязательно для заполнения.', code='required')]} ___________________________ test_create_permissions ___________________________ tests\api\v1\employees\test_positions.py:83: in test_create_permissions resp = api_client.post(url, {"name": "NewPos"}, format="json") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:299: in post response = super().post( ..\.venv\Lib\site-packages\rest_framework\test.py:213: in post return self.generic('POST', path, data, content_type, **extra) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:237: in generic return super().generic( ..\.venv\Lib\site-packages\django\test\client.py:671: in generic return self.request(**r) ^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:289: in request return super().request(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:241: in request request = super().request(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\django\test\client.py:1087: in request self.check_exception(response) ..\.venv\Lib\site-packages\django\test\client.py:802: in check_exception raise exc_value ..\.venv\Lib\site-packages\django\core\handlers\exception.py:55: in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\django\core\handlers\base.py:197: in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\django\views\decorators\csrf.py:65: in _view_wrapper return view_func(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\viewsets.py:125: in view return self.dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\views.py:515: in dispatch response = self.handle_exception(exc) ^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\views.py:475: in handle_exception self.raise_uncaught_exception(exc) ..\.venv\Lib\site-packages\rest_framework\views.py:486: in raise_uncaught_exception raise exc ..\.venv\Lib\site-packages\rest_framework\views.py:512: in dispatch response = handler(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\mixins.py:19: in create self.perform_create(serializer) api\v1\employees\views\positions.py:136: in perform_create err = _ldap_try(lambda: DirectoryService().reconcile_position(pos)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api\v1\employees\views\_helpers.py:39: in _ldap_try fn() api\v1\employees\views\positions.py:136: in err = _ldap_try(lambda: DirectoryService().reconcile_position(pos)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\directory_service.py:373: in reconcile_position return self._position_service.reconcile_position(pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\services\position_service.py:72: in reconcile_position return self._reconcile_position(conn, pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\services\position_service.py:358: in _reconcile_position pos_dn = self._ensure_position_group(conn, pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\services\position_service.py:212: in _ensure_position_group ensure_container_exists(conn, self._positions_base()) ^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\services\position_service.py:170: in _positions_base raise RuntimeError("LDAP_POSITIONS_BASE is not configured") E RuntimeError: LDAP_POSITIONS_BASE is not configured ---------------------------- Captured stderr call ----------------------------- [WARNING] 2026-02-16 17:34:54,287 django.request:253 Forbidden: /api/v1/positions/ [ERROR] 2026-02-16 17:34:54,312 django.request:253 Internal Server Error: /api/v1/positions/ Traceback (most recent call last): File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\django\views\decorators\csrf.py", line 65, in _view_wrapper return view_func(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\viewsets.py", line 125, in view return self.dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 515, in dispatch response = self.handle_exception(exc) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 475, in handle_exception self.raise_uncaught_exception(exc) File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 486, in raise_uncaught_exception raise exc File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 512, in dispatch response = handler(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\mixins.py", line 19, in create self.perform_create(serializer) File "C:\Users\igor_\Dev\EUSRR\backend\api\v1\employees\views\positions.py", line 136, in perform_create err = _ldap_try(lambda: DirectoryService().reconcile_position(pos)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\api\v1\employees\views\_helpers.py", line 39, in _ldap_try fn() File "C:\Users\igor_\Dev\EUSRR\backend\api\v1\employees\views\positions.py", line 136, in err = _ldap_try(lambda: DirectoryService().reconcile_position(pos)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\directory_service.py", line 373, in reconcile_position return self._position_service.reconcile_position(pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\position_service.py", line 72, in reconcile_position return self._reconcile_position(conn, pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\position_service.py", line 358, in _reconcile_position pos_dn = self._ensure_position_group(conn, pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\position_service.py", line 212, in _ensure_position_group ensure_container_exists(conn, self._positions_base()) ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\position_service.py", line 170, in _positions_base raise RuntimeError("LDAP_POSITIONS_BASE is not configured") RuntimeError: LDAP_POSITIONS_BASE is not configured _________________ test_update_permissions_and_search_ordering _________________ tests\api\v1\employees\test_positions.py:109: in test_update_permissions_and_search_ordering resp = api_client.patch(url_detail, {"description": "updated"}, format="json") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:315: in patch response = super().patch( ..\.venv\Lib\site-packages\rest_framework\test.py:221: in patch return self.generic('PATCH', path, data, content_type, **extra) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:237: in generic return super().generic( ..\.venv\Lib\site-packages\django\test\client.py:671: in generic return self.request(**r) ^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:289: in request return super().request(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:241: in request request = super().request(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\django\test\client.py:1087: in request self.check_exception(response) ..\.venv\Lib\site-packages\django\test\client.py:802: in check_exception raise exc_value ..\.venv\Lib\site-packages\django\core\handlers\exception.py:55: in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\django\core\handlers\base.py:197: in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\django\views\decorators\csrf.py:65: in _view_wrapper return view_func(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\viewsets.py:125: in view return self.dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\views.py:515: in dispatch response = self.handle_exception(exc) ^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\views.py:475: in handle_exception self.raise_uncaught_exception(exc) ..\.venv\Lib\site-packages\rest_framework\views.py:486: in raise_uncaught_exception raise exc ..\.venv\Lib\site-packages\rest_framework\views.py:512: in dispatch response = handler(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\mixins.py:82: in partial_update return self.update(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\mixins.py:68: in update self.perform_update(serializer) api\v1\employees\views\positions.py:142: in perform_update _ldap_try(lambda: DirectoryService().reconcile_position(pos)) api\v1\employees\views\_helpers.py:39: in _ldap_try fn() api\v1\employees\views\positions.py:142: in _ldap_try(lambda: DirectoryService().reconcile_position(pos)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\directory_service.py:373: in reconcile_position return self._position_service.reconcile_position(pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\services\position_service.py:72: in reconcile_position return self._reconcile_position(conn, pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\services\position_service.py:358: in _reconcile_position pos_dn = self._ensure_position_group(conn, pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\services\position_service.py:212: in _ensure_position_group ensure_container_exists(conn, self._positions_base()) ^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\services\position_service.py:170: in _positions_base raise RuntimeError("LDAP_POSITIONS_BASE is not configured") E RuntimeError: LDAP_POSITIONS_BASE is not configured ---------------------------- Captured stderr call ----------------------------- [WARNING] 2026-02-16 17:34:54,410 django.request:253 Forbidden: /api/v1/positions/6/ [ERROR] 2026-02-16 17:34:54,435 django.request:253 Internal Server Error: /api/v1/positions/6/ Traceback (most recent call last): File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\django\views\decorators\csrf.py", line 65, in _view_wrapper return view_func(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\viewsets.py", line 125, in view return self.dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 515, in dispatch response = self.handle_exception(exc) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 475, in handle_exception self.raise_uncaught_exception(exc) File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 486, in raise_uncaught_exception raise exc File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 512, in dispatch response = handler(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\mixins.py", line 82, in partial_update return self.update(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\mixins.py", line 68, in update self.perform_update(serializer) File "C:\Users\igor_\Dev\EUSRR\backend\api\v1\employees\views\positions.py", line 142, in perform_update _ldap_try(lambda: DirectoryService().reconcile_position(pos)) File "C:\Users\igor_\Dev\EUSRR\backend\api\v1\employees\views\_helpers.py", line 39, in _ldap_try fn() File "C:\Users\igor_\Dev\EUSRR\backend\api\v1\employees\views\positions.py", line 142, in _ldap_try(lambda: DirectoryService().reconcile_position(pos)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\directory_service.py", line 373, in reconcile_position return self._position_service.reconcile_position(pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\position_service.py", line 72, in reconcile_position return self._reconcile_position(conn, pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\position_service.py", line 358, in _reconcile_position pos_dn = self._ensure_position_group(conn, pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\position_service.py", line 212, in _ensure_position_group ensure_container_exists(conn, self._positions_base()) ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\position_service.py", line 170, in _positions_base raise RuntimeError("LDAP_POSITIONS_BASE is not configured") RuntimeError: LDAP_POSITIONS_BASE is not configured ____________________ test_set_groups_requires_special_perm ____________________ tests\api\v1\employees\test_positions.py:163: in test_set_groups_requires_special_perm resp = api_client.post(url_set, {"groups": [grp1.id, grp2.id]}, format="json") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:299: in post response = super().post( ..\.venv\Lib\site-packages\rest_framework\test.py:213: in post return self.generic('POST', path, data, content_type, **extra) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:237: in generic return super().generic( ..\.venv\Lib\site-packages\django\test\client.py:671: in generic return self.request(**r) ^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:289: in request return super().request(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:241: in request request = super().request(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\django\test\client.py:1087: in request self.check_exception(response) ..\.venv\Lib\site-packages\django\test\client.py:802: in check_exception raise exc_value ..\.venv\Lib\site-packages\django\core\handlers\exception.py:55: in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\django\core\handlers\base.py:197: in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\django\views\decorators\csrf.py:65: in _view_wrapper return view_func(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\viewsets.py:125: in view return self.dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\views.py:515: in dispatch response = self.handle_exception(exc) ^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\views.py:475: in handle_exception self.raise_uncaught_exception(exc) ..\.venv\Lib\site-packages\rest_framework\views.py:486: in raise_uncaught_exception raise exc ..\.venv\Lib\site-packages\rest_framework\views.py:512: in dispatch response = handler(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api\v1\employees\views\positions.py:70: in set_groups err2 = _ldap_try(lambda: DirectoryService().reconcile_position(pos)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api\v1\employees\views\_helpers.py:39: in _ldap_try fn() api\v1\employees\views\positions.py:70: in err2 = _ldap_try(lambda: DirectoryService().reconcile_position(pos)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\directory_service.py:373: in reconcile_position return self._position_service.reconcile_position(pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\services\position_service.py:72: in reconcile_position return self._reconcile_position(conn, pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\services\position_service.py:358: in _reconcile_position pos_dn = self._ensure_position_group(conn, pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\services\position_service.py:212: in _ensure_position_group ensure_container_exists(conn, self._positions_base()) ^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\services\position_service.py:170: in _positions_base raise RuntimeError("LDAP_POSITIONS_BASE is not configured") E RuntimeError: LDAP_POSITIONS_BASE is not configured ---------------------------- Captured stderr call ----------------------------- [WARNING] 2026-02-16 17:34:54,593 django.request:253 Forbidden: /api/v1/positions/9/set_groups/ [ERROR] 2026-02-16 17:34:54,620 django.request:253 Internal Server Error: /api/v1/positions/9/set_groups/ Traceback (most recent call last): File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\django\views\decorators\csrf.py", line 65, in _view_wrapper return view_func(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\viewsets.py", line 125, in view return self.dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 515, in dispatch response = self.handle_exception(exc) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 475, in handle_exception self.raise_uncaught_exception(exc) File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 486, in raise_uncaught_exception raise exc File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 512, in dispatch response = handler(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\api\v1\employees\views\positions.py", line 70, in set_groups err2 = _ldap_try(lambda: DirectoryService().reconcile_position(pos)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\api\v1\employees\views\_helpers.py", line 39, in _ldap_try fn() File "C:\Users\igor_\Dev\EUSRR\backend\api\v1\employees\views\positions.py", line 70, in err2 = _ldap_try(lambda: DirectoryService().reconcile_position(pos)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\directory_service.py", line 373, in reconcile_position return self._position_service.reconcile_position(pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\position_service.py", line 72, in reconcile_position return self._reconcile_position(conn, pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\position_service.py", line 358, in _reconcile_position pos_dn = self._ensure_position_group(conn, pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\position_service.py", line 212, in _ensure_position_group ensure_container_exists(conn, self._positions_base()) ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\position_service.py", line 170, in _positions_base raise RuntimeError("LDAP_POSITIONS_BASE is not configured") RuntimeError: LDAP_POSITIONS_BASE is not configured _____________ test_add_and_remove_groups_and_permissions_endpoint _____________ tests\api\v1\employees\test_positions.py:192: in test_add_and_remove_groups_and_permissions_endpoint resp = api_client.post(url_add, {"groups": [gA.id]}, format="json") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:299: in post response = super().post( ..\.venv\Lib\site-packages\rest_framework\test.py:213: in post return self.generic('POST', path, data, content_type, **extra) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:237: in generic return super().generic( ..\.venv\Lib\site-packages\django\test\client.py:671: in generic return self.request(**r) ^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:289: in request return super().request(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\test.py:241: in request request = super().request(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\django\test\client.py:1087: in request self.check_exception(response) ..\.venv\Lib\site-packages\django\test\client.py:802: in check_exception raise exc_value ..\.venv\Lib\site-packages\django\core\handlers\exception.py:55: in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\django\core\handlers\base.py:197: in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\django\views\decorators\csrf.py:65: in _view_wrapper return view_func(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\viewsets.py:125: in view return self.dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\views.py:515: in dispatch response = self.handle_exception(exc) ^^^^^^^^^^^^^^^^^^^^^^^^^^ ..\.venv\Lib\site-packages\rest_framework\views.py:475: in handle_exception self.raise_uncaught_exception(exc) ..\.venv\Lib\site-packages\rest_framework\views.py:486: in raise_uncaught_exception raise exc ..\.venv\Lib\site-packages\rest_framework\views.py:512: in dispatch response = handler(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api\v1\employees\views\positions.py:87: in add_groups err2 = _ldap_try(lambda: DirectoryService().reconcile_position(pos)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api\v1\employees\views\_helpers.py:39: in _ldap_try fn() api\v1\employees\views\positions.py:87: in err2 = _ldap_try(lambda: DirectoryService().reconcile_position(pos)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\directory_service.py:373: in reconcile_position return self._position_service.reconcile_position(pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\services\position_service.py:72: in reconcile_position return self._reconcile_position(conn, pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\services\position_service.py:358: in _reconcile_position pos_dn = self._ensure_position_group(conn, pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\services\position_service.py:212: in _ensure_position_group ensure_container_exists(conn, self._positions_base()) ^^^^^^^^^^^^^^^^^^^^^^ employees\ldap\services\position_service.py:170: in _positions_base raise RuntimeError("LDAP_POSITIONS_BASE is not configured") E RuntimeError: LDAP_POSITIONS_BASE is not configured ---------------------------- Captured stderr call ----------------------------- [ERROR] 2026-02-16 17:34:54,811 django.request:253 Internal Server Error: /api/v1/positions/10/add_groups/ Traceback (most recent call last): File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\django\views\decorators\csrf.py", line 65, in _view_wrapper return view_func(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\viewsets.py", line 125, in view return self.dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 515, in dispatch response = self.handle_exception(exc) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 475, in handle_exception self.raise_uncaught_exception(exc) File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 486, in raise_uncaught_exception raise exc File "C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\rest_framework\views.py", line 512, in dispatch response = handler(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\api\v1\employees\views\positions.py", line 87, in add_groups err2 = _ldap_try(lambda: DirectoryService().reconcile_position(pos)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\api\v1\employees\views\_helpers.py", line 39, in _ldap_try fn() File "C:\Users\igor_\Dev\EUSRR\backend\api\v1\employees\views\positions.py", line 87, in err2 = _ldap_try(lambda: DirectoryService().reconcile_position(pos)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\directory_service.py", line 373, in reconcile_position return self._position_service.reconcile_position(pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\position_service.py", line 72, in reconcile_position return self._reconcile_position(conn, pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\position_service.py", line 358, in _reconcile_position pos_dn = self._ensure_position_group(conn, pos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\position_service.py", line 212, in _ensure_position_group ensure_container_exists(conn, self._positions_base()) ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\igor_\Dev\EUSRR\backend\employees\ldap\services\position_service.py", line 170, in _positions_base raise RuntimeError("LDAP_POSITIONS_BASE is not configured") RuntimeError: LDAP_POSITIONS_BASE is not configured ________ TestRoleAssignmentEndpoints.test_assign_role_to_any_employee _________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly ________________ TestRoleAssignmentEndpoints.test_revoke_role _________________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly ______________ TestRoleAssignmentEndpoints.test_assignments_list ______________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _________ TestRoleAssignmentEndpoints.test_assign_requires_permission _________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly ________ TestRoleAssignmentEndpoints.test_assign_with_dept_permission _________ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly ___ TestRoleAssignmentPermissions.test_permission_check_via_role_assignment ___ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly _ TestRoleAssignmentPermissions.test_inactive_assignment_does_not_grant_permission _ Fixture "make_user" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly ============================== warnings summary =============================== ..\.venv\Lib\site-packages\pyasn1\codec\ber\encoder.py:952 C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\pyasn1\codec\ber\encoder.py:952: DeprecationWarning: tagMap is deprecated. Please use TAG_MAP instead. warnings.warn(f"{attr} is deprecated. Please use {newAttr} instead.", DeprecationWarning) ..\.venv\Lib\site-packages\pyasn1\codec\ber\encoder.py:952 C:\Users\igor_\Dev\EUSRR\.venv\Lib\site-packages\pyasn1\codec\ber\encoder.py:952: DeprecationWarning: typeMap is deprecated. Please use TYPE_MAP instead. warnings.warn(f"{attr} is deprecated. Please use {newAttr} instead.", DeprecationWarning) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== short test summary info =========================== FAILED tests/api/v1/employees/test_department_head_rights.py::test_head_can_update_department_without_explicit_role_perms FAILED tests/api/v1/employees/test_department_head_rights.py::test_head_can_set_member_role_and_non_head_cannot FAILED tests/api/v1/employees/test_department_head_rights.py::test_head_can_change_head_and_loses_rights_afterwards FAILED tests/api/v1/employees/test_department_membership_separation.py::test_add_member_requires_manage_and_does_not_assign_role FAILED tests/api/v1/employees/test_department_membership_separation.py::test_all_three_actions_require_auth_and_permissions FAILED tests/api/v1/employees/test_department_membership_separation.py::test_set_member_role_requires_assign_not_manage FAILED tests/api/v1/employees/test_department_membership_separation.py::test_set_member_role_does_not_create_membership_and_does_not_toggle_active FAILED tests/api/v1/employees/test_department_membership_separation.py::test_add_member_ignores_role_parameter FAILED tests/api/v1/employees/test_department_membership_separation.py::test_remove_member_requires_manage_and_does_not_touch_role FAILED tests/api/v1/employees/test_department_roles.py::test_list_filtered_by_department FAILED tests/api/v1/employees/test_department_roles.py::test_create_requires_assign_department_role FAILED tests/api/v1/employees/test_department_roles.py::test_update_and_destroy_scope_enforced FAILED tests/api/v1/employees/test_department_roles.py::test_perm_choices_and_perms_and_set_perms FAILED tests/api/v1/employees/test_department_roles.py::test_set_perms_validates_payload FAILED tests/api/v1/employees/test_department_roles.py::test_back_compat_permissions_field_contains_ids FAILED tests/api/v1/employees/test_department_roles.py::test_create_with_scoped_permission_codes_and_update_name FAILED tests/api/v1/employees/test_department_roles.py::test_cross_department_access_denied_for_set_perms FAILED tests/api/v1/employees/test_department_roles_extra.py::test_read_only_allowed_without_assign FAILED tests/api/v1/employees/test_department_roles_extra.py::test_staff_override_for_write FAILED tests/api/v1/employees/test_department_roles_extra.py::test_ordering_stable_by_name_then_id FAILED tests/api/v1/employees/test_department_roles_extra.py::test_set_perms_ids_take_precedence_over_codes FAILED tests/api/v1/employees/test_department_roles_extra.py::test_serializer_codes_override_scoped_permissions_on_create FAILED tests/api/v1/employees/test_department_roles_extra.py::test_perm_choices_fields_and_nonempty FAILED tests/api/v1/employees/test_department_roles_extra.py::test_destroy_requires_assign_in_same_department FAILED tests/api/v1/employees/test_department_roles_extra.py::test_set_perms_dedup_and_replace_semantics FAILED tests/api/v1/employees/test_departments.py::test_list_ok_for_authenticated FAILED tests/api/v1/employees/test_departments.py::test_search_and_ordering FAILED tests/api/v1/employees/test_departments.py::test_employees_count_adds_head_if_not_in_links FAILED tests/api/v1/employees/test_departments.py::test_employees_count_not_double_count_head_if_in_links FAILED tests/api/v1/employees/test_departments.py::test_create_requires_staff FAILED tests/api/v1/employees/test_departments.py::test_destroy_requires_staff FAILED tests/api/v1/employees/test_departments.py::test_partial_update_name_requires_manage_perm FAILED tests/api/v1/employees/test_departments.py::test_partial_update_head_requires_change_head_perm FAILED tests/api/v1/employees/test_departments.py::test_partial_update_head_same_value_does_not_require_extra_perm FAILED tests/api/v1/employees/test_departments.py::test_set_head_by_role_with_perm FAILED tests/api/v1/employees/test_departments.py::test_set_head_validation_inactive_employee FAILED tests/api/v1/employees/test_departments.py::test_set_head_remove_with_null FAILED tests/api/v1/employees/test_departments.py::test_set_head_requires_perm FAILED tests/api/v1/employees/test_departments.py::test_set_member_role_happy_path FAILED tests/api/v1/employees/test_departments.py::test_set_member_role_reject_foreign_role FAILED tests/api/v1/employees/test_departments.py::test_set_member_role_requires_perm FAILED tests/api/v1/employees/test_departments.py::test_set_member_role_missing_employee_id FAILED tests/api/v1/employees/test_email_verification_security.py::TestEmailChangeResetsVerification::test_change_email_resets_email_verified_for_self FAILED tests/api/v1/employees/test_email_verification_security.py::TestEmailChangeResetsVerification::test_change_email_via_me_endpoint_resets_verification FAILED tests/api/v1/employees/test_email_verification_security.py::TestEmailChangeResetsVerification::test_change_email_sends_verification_code FAILED tests/api/v1/employees/test_email_verification_security.py::TestEmailChangeResetsVerification::test_change_other_fields_does_not_reset_verification FAILED tests/api/v1/employees/test_email_verification_security.py::TestEmailChangeResetsVerification::test_change_email_to_same_value_does_not_reset FAILED tests/api/v1/employees/test_email_verification_security.py::TestUnverifiedUserRestrictions::test_unverified_user_can_update_self_non_critical_fields FAILED tests/api/v1/employees/test_email_verification_security.py::TestUnverifiedUserRestrictions::test_unverified_user_can_verify_email FAILED tests/api/v1/employees/test_email_verification_security.py::TestUnverifiedUserRestrictions::test_unverified_user_can_resend_code FAILED tests/api/v1/employees/test_email_verification_security.py::TestResendEmailLogic::test_resend_email_generates_new_code FAILED tests/api/v1/employees/test_email_verification_security.py::TestResendEmailLogic::test_resend_email_to_verified_user_fails FAILED tests/api/v1/employees/test_email_verification_security.py::TestResendEmailLogic::test_old_code_becomes_invalid_after_resend FAILED tests/api/v1/employees/test_email_verification_security.py::TestEmailVerificationWorkflow::test_full_registration_and_verification_flow FAILED tests/api/v1/employees/test_email_verification_security.py::TestEmailVerificationWorkflow::test_change_email_and_verify_new_one FAILED tests/api/v1/employees/test_employee_actions.py::test_dismissal_works_when_ldap_disabled FAILED tests/api/v1/employees/test_employee_actions.py::test_restoration_moves_from_dismissed_to_users FAILED tests/api/v1/employees/test_employees.py::test_create_requires_staff FAILED tests/api/v1/employees/test_employees.py::test_destroy_requires_admin FAILED tests/api/v1/employees/test_employees.py::test_me_patch_rejects_when_all_contacts_empty FAILED tests/api/v1/employees/test_employees_fields_in_list.py::test_list_includes_basic_fields FAILED tests/api/v1/employees/test_employees_fields_in_list.py::test_list_departments_include_role FAILED tests/api/v1/employees/test_ldap_optional_register.py::test_register_without_ldap_creates_user_only_in_db FAILED tests/api/v1/employees/test_positions.py::test_create_permissions - Ru... FAILED tests/api/v1/employees/test_positions.py::test_update_permissions_and_search_ordering FAILED tests/api/v1/employees/test_positions.py::test_set_groups_requires_special_perm FAILED tests/api/v1/employees/test_positions.py::test_add_and_remove_groups_and_permissions_endpoint FAILED tests/api/v1/employees/test_role_assignment.py::TestRoleAssignmentEndpoints::test_assign_role_to_any_employee FAILED tests/api/v1/employees/test_role_assignment.py::TestRoleAssignmentEndpoints::test_revoke_role FAILED tests/api/v1/employees/test_role_assignment.py::TestRoleAssignmentEndpoints::test_assignments_list FAILED tests/api/v1/employees/test_role_assignment.py::TestRoleAssignmentEndpoints::test_assign_requires_permission FAILED tests/api/v1/employees/test_role_assignment.py::TestRoleAssignmentEndpoints::test_assign_with_dept_permission FAILED tests/api/v1/employees/test_role_assignment.py::TestRoleAssignmentPermissions::test_permission_check_via_role_assignment FAILED tests/api/v1/employees/test_role_assignment.py::TestRoleAssignmentPermissions::test_inactive_assignment_does_not_grant_permission ERROR tests/api/v1/employees/test_ldap_optional_groups.py::test_create_group_without_ldap ERROR tests/api/v1/employees/test_ldap_optional_groups.py::test_add_members_without_ldap ERROR tests/api/v1/employees/test_ldap_optional_groups.py::test_destroy_group_without_ldap ERROR tests/api/v1/employees/test_ldap_optional_groups.py::test_get_members_without_ldap ====== 74 failed, 59 passed, 13 skipped, 2 warnings, 4 errors in 17.79s =======