mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-06 01:59:55 +02:00
Resolve "Implement a Oauth provider in Funkwhale"
This commit is contained in:
parent
1dc7304bd3
commit
4c13d47387
54 changed files with 2811 additions and 249 deletions
21
api/tests/users/oauth/test_models.py
Normal file
21
api/tests/users/oauth/test_models.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
import pytest
|
||||
|
||||
from django import forms
|
||||
|
||||
from funkwhale_api.users import models
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"uri",
|
||||
["urn:ietf:wg:oauth:2.0:oob", "urn:ietf:wg:oauth:2.0:oob:auto", "http://test.com"],
|
||||
)
|
||||
def test_redirect_uris_oob(uri, db):
|
||||
app = models.Application(redirect_uris=uri)
|
||||
assert app.clean() is None
|
||||
|
||||
|
||||
@pytest.mark.parametrize("uri", ["urn:ietf:wg:oauth:2.0:invalid", "noop"])
|
||||
def test_redirect_uris_invalid(uri, db):
|
||||
app = models.Application(redirect_uris=uri)
|
||||
with pytest.raises(forms.ValidationError):
|
||||
app.clean()
|
Loading…
Add table
Add a link
Reference in a new issue