Holger Frey
7 years ago
14 changed files with 49 additions and 19 deletions
@ -1,8 +1,8 @@
@@ -1,8 +1,8 @@
|
||||
''' functional tests for ordr2.views.errors ''' |
||||
|
||||
from . import testapp |
||||
from . import testapp # noqa: F401 |
||||
|
||||
|
||||
def test_404(testapp): |
||||
def test_404(testapp): # noqa: F811 |
||||
result = testapp.get('/unknown', status=404) |
||||
assert '404' in result |
||||
|
@ -1,13 +1,13 @@
@@ -1,13 +1,13 @@
|
||||
''' functional tests for ordr2.views.pages ''' |
||||
|
||||
from . import testapp |
||||
from . import testapp # noqa: F401 |
||||
|
||||
|
||||
def test_welcome(testapp): |
||||
def test_welcome(testapp): # noqa: F811 |
||||
result = testapp.get('/') |
||||
assert 'Ordr' in result |
||||
|
||||
|
||||
def test_faq(testapp): |
||||
def test_faq(testapp): # noqa: F811 |
||||
result = testapp.get('/faq') |
||||
assert 'FAQ' in result |
||||
|
@ -0,0 +1,14 @@
@@ -0,0 +1,14 @@
|
||||
|
||||
def test_root_init(): |
||||
from ordr.resources import RootResource |
||||
root = RootResource('request') |
||||
assert root.__name__ == None |
||||
assert root.__parent__ == None |
||||
assert root.request == 'request' |
||||
|
||||
|
||||
def test_root_acl(): |
||||
from pyramid.security import Allow, Everyone, DENY_ALL |
||||
from ordr.resources import RootResource |
||||
root = RootResource(None) |
||||
assert root.__acl__() == [(Allow, Everyone, 'view'), DENY_ALL] |
@ -0,0 +1,17 @@
@@ -0,0 +1,17 @@
|
||||
|
||||
def test_crypt_context_to_settings(): |
||||
from ordr.security import crypt_context_settings_to_string |
||||
settings = { |
||||
'no_prefix': 'should not appear', |
||||
'prefix.something': 'left unchanged', |
||||
'prefix.schemes': 'adjust list', |
||||
'prefix.depreceated': 'do, not, adjust, this, list' |
||||
} |
||||
result = crypt_context_settings_to_string(settings, 'prefix.') |
||||
expected_lines = { |
||||
'[passlib]', |
||||
'something = left unchanged', |
||||
'schemes = adjust,list', |
||||
'depreceated = do, not, adjust, this, list', |
||||
} |
||||
assert set(result.split('\n')) == expected_lines |
Reference in new issue