Authorization in constructors
If a contract’s constructor callsrequire_auth() (or require_auth_for_args()), both env.register(...) and env.register_at(...) switch the environment to recording-auth mode for the duration of the constructor invocation, inheriting the mode from the current auth manager. Once the constructor returns, the previous auth manager is restored. This means constructor auth checks succeed for contracts registered with either function, without requiring mock_all_auths() to be called first.
To have auth in a constructor execute as it will in production the contract must be deployed in the test using the standard deployment functions after being built to Wasm.