Browse Source

cleanup after linting

rework
Holger Frey 7 years ago
parent
commit
a21612cf0e
  1. 13
      ordr/tests/security.py

13
ordr/tests/security.py

@ -2,7 +2,7 @@ import pytest @@ -2,7 +2,7 @@ import pytest
from pyramid.testing import DummyRequest
from . import app_config, dbsession, get_example_user
from . import app_config, dbsession, get_example_user # noqa: F401
def test_crypt_context_to_settings():
@ -47,7 +47,7 @@ def test_authentication_policy_effective_principals_no_user(): @@ -47,7 +47,7 @@ def test_authentication_policy_effective_principals_no_user():
assert result == [Everyone]
def test_authentication_policy_effective_principals_no_user():
def test_authentication_policy_effective_principals_with_user():
from ordr.security import AuthenticationPolicy
from ordr.models import User, Role
from pyramid.security import Authenticated, Everyone
@ -65,7 +65,7 @@ def test_authentication_policy_effective_principals_no_user(): @@ -65,7 +65,7 @@ def test_authentication_policy_effective_principals_no_user():
assert result == expected
@pytest.mark.parametrize(
@pytest.mark.parametrize( # noqa: F811
'uauid,role_name', [
(3, 'USER'),
(4, 'PURCHASER'),
@ -74,7 +74,7 @@ def test_authentication_policy_effective_principals_no_user(): @@ -74,7 +74,7 @@ def test_authentication_policy_effective_principals_no_user():
)
def test_get_user_returns_user(dbsession, uauid, role_name):
from ordr.security import get_user
from ordr.models import User, Role
from ordr.models import Role
# this is a dirty hack, but DummyRequest does not accept setting an
# unauthenticated_userid
from pyramid.testing import DummyResource
@ -86,8 +86,7 @@ def test_get_user_returns_user(dbsession, uauid, role_name): @@ -86,8 +86,7 @@ def test_get_user_returns_user(dbsession, uauid, role_name):
assert get_user(request) == user
@pytest.mark.parametrize(
@pytest.mark.parametrize( # noqa: F811
'uauid,role_name', [
(1, 'UNVALIDATED'),
(2, 'NEW'),
@ -98,7 +97,7 @@ def test_get_user_returns_user(dbsession, uauid, role_name): @@ -98,7 +97,7 @@ def test_get_user_returns_user(dbsession, uauid, role_name):
)
def test_get_user_returns_none(dbsession, uauid, role_name):
from ordr.security import get_user
from ordr.models import User, Role
from ordr.models import Role
# this is a dirty hack, but DummyRequest does not accept setting an
# unauthenticated_userid
from pyramid.testing import DummyResource