def test_orgchart_allowed_as_private(self, mock_scope, mock_get):
        response = mock.Mock()
        response.json.return_value = {'foo': 'bar'}

        # Mock UserAccessLevel class and attributes
        mock_scope.get_privacy.return_value = 'private'
        mock_scope.PRIVATE = 'private'

        mock_get.return_value = response
        request = self.factory.get('/')
        request.user = UserFactory.create()
        resp = views.orgchart(request)
        mock_get.assert_called_with('http://orgchart-svc/orgchart')
        self.assertEqual(resp.content, '{"foo": "bar"}')
 def test_orgchart_forbidden(self, mock_scope):
     mock_scope.get_privacy.return_value = 'dummy'
     request = self.factory.get('/')
     request.user = UserFactory.create()
     resp = views.orgchart(request)
     self.assertEqual(resp.status_code, 403)