API - OAuth2 scopes tests refacto
This commit is contained in:
@@ -7,6 +7,7 @@ from fittrackee.users.models import User
|
||||
from fittrackee.workouts.models import Sport, Workout
|
||||
|
||||
from ..mixins import ApiTestCaseMixin
|
||||
from ..utils import OAUTH_SCOPES
|
||||
|
||||
|
||||
class TestGetStatsByTime(ApiTestCaseMixin):
|
||||
@@ -864,15 +865,7 @@ class TestGetStatsByTime(ApiTestCaseMixin):
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'client_scope, can_access',
|
||||
[
|
||||
('application:write', False),
|
||||
('profile:read', False),
|
||||
('profile:write', False),
|
||||
('users:read', False),
|
||||
('users:write', False),
|
||||
('workouts:read', True),
|
||||
('workouts:write', False),
|
||||
],
|
||||
{**OAUTH_SCOPES, 'workouts:read': True}.items(),
|
||||
)
|
||||
def test_expected_scopes_are_defined(
|
||||
self,
|
||||
@@ -1045,15 +1038,7 @@ class TestGetStatsBySport(ApiTestCaseMixin):
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'client_scope, can_access',
|
||||
[
|
||||
('application:write', False),
|
||||
('profile:read', False),
|
||||
('profile:write', False),
|
||||
('users:read', False),
|
||||
('users:write', False),
|
||||
('workouts:read', True),
|
||||
('workouts:write', False),
|
||||
],
|
||||
{**OAUTH_SCOPES, 'workouts:read': True}.items(),
|
||||
)
|
||||
def test_expected_scopes_are_defined(
|
||||
self,
|
||||
@@ -1164,15 +1149,7 @@ class TestGetAllStats(ApiTestCaseMixin):
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'client_scope, can_access',
|
||||
[
|
||||
('application:write', False),
|
||||
('profile:read', False),
|
||||
('profile:write', False),
|
||||
('users:read', False),
|
||||
('users:write', False),
|
||||
('workouts:read', True),
|
||||
('workouts:write', False),
|
||||
],
|
||||
{**OAUTH_SCOPES, 'workouts:read': True}.items(),
|
||||
)
|
||||
def test_expected_scopes_are_defined(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user