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
Labels
Merge Requests
137
Merge Requests
137
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
d0a6c859
Commit
d0a6c859
authored
Jun 22, 2020
by
Jérome Perrin
Committed by
Gabriel Monnerat
Aug 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oauth_google_login: minimal logout test
parent
ea650019
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
23 deletions
+0
-23
bt5/erp5_oauth_google_login/TestTemplateItem/portal_components/test.erp5.testGoogleLogin.py
...mplateItem/portal_components/test.erp5.testGoogleLogin.py
+0
-23
No files found.
bt5/erp5_oauth_google_login/TestTemplateItem/portal_components/test.erp5.testGoogleLogin.py
View file @
d0a6c859
...
...
@@ -309,26 +309,3 @@ return credential_request
def
test_logout
(
self
):
resp
=
self
.
publish
(
self
.
portal
.
getId
()
+
'/logout'
)
self
.
assertEqual
(
resp
.
getCookie
(
"__ac_google_hash"
)[
'value'
],
'deleted'
)
class
TestERP5JSGoogleLogin
(
GoogleLoginTestCase
):
def
_getWebSite
(
self
):
return
self
.
portal
.
web_site_module
.
renderjs_runner
def
test_login_form
(
self
):
resp
=
self
.
publish
(
self
.
_getWebSite
().
getPath
()
+
'/login_form'
)
tree
=
lxml
.
etree
.
fromstring
(
resp
.
getBody
(),
parser
=
lxml
.
etree
.
HTMLParser
())
google_login_link
,
=
[
img
.
getparent
().
attrib
[
'href'
]
for
img
in
tree
.
findall
(
'.//a/img'
)
if
img
.
attrib
[
'alt'
]
==
'Sign in with Google'
]
self
.
assertIn
(
'/ERP5Site_redirectToGoogleLoginPage'
,
google_login_link
)
resp
=
self
.
publish
(
urlparse
.
urlparse
(
google_login_link
).
path
)
# this request redirects to google
self
.
assertEqual
(
resp
.
getStatus
(),
httplib
.
FOUND
)
self
.
assertIn
(
'google.com'
,
resp
.
getHeader
(
'Location'
))
def
test_logout
(
self
):
resp
=
self
.
publish
(
self
.
_getWebSite
().
getPath
()
+
'/WebSite_logout'
)
self
.
assertEqual
(
resp
.
getCookie
(
"__ac_google_hash"
)[
'value'
],
'deleted'
)
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