code: def test_unauthorized(self, api, mocker):
      response = mocker.Mock()
      response.headers = {}
      response = api.unauthorized(response)
      assert (
          response.headers["WWW-Authenticate"]
          == 'Basic realm="flask-restplus"'
      )
  
imports: from __future__ import unicode_literals
  import flask
  import pytest
  import six
  from json import dumps, JSONEncoder
  from flask import Blueprint, redirect, views
  from werkzeug.exceptions import HTTPException, Unauthorized, BadRequest
  import flask_restplus
label_desc: Use image node_id 2 for calling the APITest obj's underlying member method code with example usage: obj.test_unauthorized(api, mocker) without return types