mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 10:09:20 +02:00
Fixed inconsistencies between test and prod requests
This commit is contained in:
parent
de777764da
commit
e1ebd4988b
4 changed files with 83 additions and 41 deletions
|
@ -20,14 +20,17 @@ def test_authenticate(nodb_factories, mocker, api_request):
|
|||
})
|
||||
signed_request = nodb_factories['federation.SignedRequest'](
|
||||
auth__key=private,
|
||||
auth__key_id=actor_url + '#main-key'
|
||||
auth__key_id=actor_url + '#main-key',
|
||||
auth__headers=[
|
||||
'date',
|
||||
]
|
||||
)
|
||||
prepared = signed_request.prepare()
|
||||
django_request = api_request.get(
|
||||
'/',
|
||||
headers={
|
||||
'Date': prepared.headers['date'],
|
||||
'Signature': prepared.headers['signature'],
|
||||
**{
|
||||
'HTTP_DATE': prepared.headers['date'],
|
||||
'HTTP_SIGNATURE': prepared.headers['signature'],
|
||||
}
|
||||
)
|
||||
authenticator = authentication.SignatureAuthentication()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue