Esempio n. 1
0
    def setUp(self):
        self.server_urls = {
            'check-credentials': 'https://some.where/api2/check_credentials/',
            'login': '******',
            'logout': 'https://some.where/api2/logout/'}

        def mock_get(url, timeout):
            result = mock.Mock()
            result.status_code = 200
            result.json.return_value = self.server_urls
            return result

        with mock.patch('requests.get', mock_get):
            # Fill the cache
            views.sso_server_url('login')

        self.request_factory = RequestFactory()
Esempio n. 2
0
 def test_sso_server_url(self):
     self.assertEqual('https://some.where/api2/logout/',
                      views.sso_server_url('logout'))