Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tristan Cavelier
erp5
Commits
9c2719b0
Commit
9c2719b0
authored
Feb 26, 2019
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
access_token: fix problems reported by pylint
parent
f1bbc5aa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
bt5/erp5_access_token/SkinTemplateItem/portal_skins/erp5_access_token/RestrictedAccessToken_init.py
...tal_skins/erp5_access_token/RestrictedAccessToken_init.py
+1
-1
bt5/erp5_access_token/TestTemplateItem/portal_components/test.erp5.testERP5DumbHTTPExtractionPlugin.py
..._components/test.erp5.testERP5DumbHTTPExtractionPlugin.py
+5
-3
No files found.
bt5/erp5_access_token/SkinTemplateItem/portal_skins/erp5_access_token/RestrictedAccessToken_init.py
View file @
9c2719b0
alpha
=
'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
alpha
=
'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
random_id
=
''
random_id
=
''
for
i
in
range
(
0
,
128
):
for
_
in
range
(
0
,
128
):
random_id
+=
random
.
choice
(
alpha
)
random_id
+=
random
.
choice
(
alpha
)
# Define Reference from ID provided by portal_ids
# Define Reference from ID provided by portal_ids
...
...
bt5/erp5_access_token/TestTemplateItem/portal_components/test.erp5.testERP5DumbHTTPExtractionPlugin.py
View file @
9c2719b0
...
@@ -56,7 +56,9 @@ class TestERP5DumbHTTPExtractionPlugin(ERP5TypeTestCase):
...
@@ -56,7 +56,9 @@ class TestERP5DumbHTTPExtractionPlugin(ERP5TypeTestCase):
transaction
.
commit
()
transaction
.
commit
()
self
.
tic
()
self
.
tic
()
def
do_fake_request
(
self
,
request_method
,
headers
=
{}):
def
do_fake_request
(
self
,
request_method
,
headers
=
None
):
if
headers
is
None
:
headers
=
{}
__version__
=
"0.1"
__version__
=
"0.1"
env
=
{}
env
=
{}
env
[
'SERVER_NAME'
]
=
'bobo.server'
env
[
'SERVER_NAME'
]
=
'bobo.server'
...
@@ -103,7 +105,7 @@ class TestERP5DumbHTTPExtractionPlugin(ERP5TypeTestCase):
...
@@ -103,7 +105,7 @@ class TestERP5DumbHTTPExtractionPlugin(ERP5TypeTestCase):
return
person
return
person
def
test_working_authentication
(
self
):
def
test_working_authentication
(
self
):
person
=
self
.
person
=
self
.
_createPerson
(
self
.
new_id
,
"test"
)
self
.
_createPerson
(
self
.
new_id
,
"test"
)
request
=
self
.
do_fake_request
(
"GET"
,
{
"HTTP_AUTHORIZATION"
:
"Basic "
+
base64
.
b64encode
(
"%s:test"
%
self
.
new_id
)})
request
=
self
.
do_fake_request
(
"GET"
,
{
"HTTP_AUTHORIZATION"
:
"Basic "
+
base64
.
b64encode
(
"%s:test"
%
self
.
new_id
)})
ret
=
ERP5DumbHTTPExtractionPlugin
(
"default_extraction"
).
extractCredentials
(
request
)
ret
=
ERP5DumbHTTPExtractionPlugin
(
"default_extraction"
).
extractCredentials
(
request
)
self
.
assertEqual
s
(
ret
,
{
'login'
:
self
.
new_id
,
'password'
:
'test'
,
'remote_host'
:
'bobo.remote.host'
,
'remote_address'
:
'204.183.226.81 '
})
self
.
assertEqual
(
ret
,
{
'login'
:
self
.
new_id
,
'password'
:
'test'
,
'remote_host'
:
'bobo.remote.host'
,
'remote_address'
:
'204.183.226.81 '
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment