Fixed #23806 -- Added a test case for settings.DISALLOWED_USER_AGENTS.

Made changes asked in review by timgraham

- Added a check for the logger warning.