Exemplo n.º 1
0
 def test_check(self):
     aa = AccountingAuthorization()
     session = MagicMock()
     token = "Token 1234"
     ok, reason = aa.check(token, session)
     assert not ok
     json = {"auth": token}
     session.post.assert_called_once_with(aa.endpoint_url(), headers=aa.headers(), json=json)
Exemplo n.º 2
0
 def test_check(self):
     aa = AccountingAuthorization()
     session = MagicMock()
     token = 'Token 1234'
     ok, reason = aa.check(token, session)
     assert not ok
     json = {
         'auth': token,
     }
     session.post.assert_called_once_with(aa.endpoint_url(), headers=aa.headers(), json=json)
Exemplo n.º 3
0
 def test_headers(self, settings):
     aa = AccountingAuthorization()
     settings.ACCOUNTING_APISECRET = 'foo und bar'
     headers = aa.headers()
     assert len(headers) == 1
     assert headers['APISECRET'] == 'foo und bar'
Exemplo n.º 4
0
 def test_headers(self, settings):
     aa = AccountingAuthorization()
     settings.ACCOUNTING_APISECRET = "foo und bar"
     headers = aa.headers()
     assert len(headers) == 1
     assert headers["APISECRET"] == "foo und bar"