mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-23 11:51:05 -05:00
mock_has_permissions blindly returns True - this is useful for the decorators on most endpoints checking if the user has permission to access endpoints about the provided service, but is not useful when it returns true to such checks as "if user is platform admin, show secret stuff", despite the logged in user being "active_user_with_permissions" rather than a platform admin. So remove this, and add "logged_in_platform_admin_client" for when we want to explicitly check platform admin functionality. This has the advantage of the actual permissions code being checked in tests, so the test environment is more consistent with the real world. Several tests will have to change now though - active_user_with_perms has permissions for service_one, so most tests should now call client.get(url_for(..., service_id=service_one['id']) or they'll 403