Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
e8963598
Commit
e8963598
authored
Apr 19, 2016
by
Adam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix flaky oauth test (#12168)
parent
298770e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
common/test/acceptance/tests/lms/test_oauth2.py
+18
-4
No files found.
common/test/acceptance/tests/lms/test_oauth2.py
View file @
e8963598
...
...
@@ -44,13 +44,27 @@ class OAuth2PermissionDelegationTests(WebAppTest):
assert
self
.
oauth_page
.
visit
()
self
.
oauth_page
.
cancel
()
def
check_redirect
():
"""
Checks that the page correctly redirects to a url with a
denied query param.
"""
query
=
self
.
_qs
(
self
.
browser
.
current_url
)
return
'access_denied'
in
query
[
'error'
]
def
check_redirect_chrome
():
"""
Similar to `check_redirect`, but, due to a bug in ChromeDriver,
we use `self.browser.title` here instead of `self.browser.current_url`
"""
query
=
self
.
_qs
(
self
.
browser
.
title
)
return
'access_denied'
in
query
[
'error'
]
# This redirects to an invalid URI. For chrome verify title, current_url otherwise
if
self
.
browser
.
name
==
'chrome'
:
query
=
self
.
_qs
(
self
.
browser
.
title
)
self
.
assertIn
(
'access_denied'
,
query
[
'error'
])
self
.
oauth_page
.
wait_for
(
check_redirect_chrome
,
'redirected to invalid URL (chrome)'
)
else
:
query
=
self
.
_qs
(
self
.
browser
.
current_url
)
self
.
assertIn
(
'access_denied'
,
query
[
'error'
])
self
.
oauth_page
.
wait_for
(
check_redirect
,
'redirected to invalid URL'
)
@flaky
# TODO, fix this: TNL-4190
def
test_accepting_redirects
(
self
):
...
...
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