mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-03 22:19:16 +02:00
See #170: now record downloads count on tracks/uploads
This commit is contained in:
parent
3674d1235d
commit
b22b9c83b0
12 changed files with 161 additions and 18 deletions
|
@ -10,15 +10,14 @@ def test_get_ident_anonymous(api_request):
|
|||
|
||||
expected = {"id": ip, "type": "anonymous"}
|
||||
|
||||
assert throttling.get_ident(request) == expected
|
||||
assert throttling.get_ident(None, request) == expected
|
||||
|
||||
|
||||
def test_get_ident_authenticated(api_request, factories):
|
||||
user = factories["users.User"]()
|
||||
request = api_request.get("/")
|
||||
setattr(request, "user", user)
|
||||
expected = {"id": user.pk, "type": "authenticated"}
|
||||
assert throttling.get_ident(request) == expected
|
||||
assert throttling.get_ident(user, request) == expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue