Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
test that old auth still works
Browse files Browse the repository at this point in the history
  • Loading branch information
Changaco committed Feb 5, 2015
1 parent d73e87d commit 0648026
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/py/test_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@ def test_session_cookie_not_set_under_API_key_auth(self):
assert SESSION not in response.headers.cookie


def test_old_API_key_auth(self):
alice = self.make_participant('alice', claimed_time='now')
api_key = alice.recreate_api_key()

auth_header = b'Basic ' + b64encode(b'%s:' % api_key)
response = self.client.GET( '/alice/public.json'
, HTTP_AUTHORIZATION=auth_header
, HTTP_X_FORWARDED_PROTO=b'https'
, HTTP_HOST=b'gratipay.com'
)

assert response.code == 200


def test_bad_userid_returns_401(self):
self.make_participant('alice', claimed_time='now')
auth_header = b'Basic ' + b64encode(b'foo:')
Expand Down

0 comments on commit 0648026

Please sign in to comment.