def test_get_orphan_resource(self, mock_factory, mock_resp): """ Test get OrphanResourceView, which should return a dict describing an orphan. """ mock_orphan_manager = mock.MagicMock() mock_orphan_manager.get_orphan.return_value = {'_id': 'orphan'} mock_factory.content_orphan_manager.return_value = mock_orphan_manager request = mock.MagicMock() request.get_full_path.return_value = '/mock/path/' orphan_resource = OrphanResourceView() response = orphan_resource.get(request, 'mock_type', 'mock_id') expected_content = {'_id': 'orphan', '_href': '/mock/path/'} mock_resp.assert_called_once_with(expected_content) self.assertTrue(response is mock_resp.return_value)