def METHOD_NAME(self, mock_rq, mock_log):
    mock_rq.objects.get.side_effect = ResourceQuota.DoesNotExist
    mock_rq.DoesNotExist = ResourceQuota.DoesNotExist
    ret = utilities.get_resource_available(mock.MagicMock(), "codename")
    mock_log.warning.assert_called_with(
        "Invalid Codename: ResourceQuota with codename codename does not exist."
    )
    self.assertEqual(None, ret)