Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-cas
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
OpenEdx
django-cas
Commits
5538e907
Commit
5538e907
authored
Dec 01, 2010
by
Ed Crewe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check changes
parent
b1ae6a56
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
django_cas/tests/cas_tests.py
+5
-3
No files found.
django_cas/tests/cas_tests.py
View file @
5538e907
...
@@ -98,7 +98,7 @@ class TestCAS(unittest.TestCase):
...
@@ -98,7 +98,7 @@ class TestCAS(unittest.TestCase):
dom
=
dom
.
getElementsByTagName
(
level
)[
0
]
dom
=
dom
.
getElementsByTagName
(
level
)[
0
]
except
:
except
:
break
break
return
dom
.
childNodes
[
0
]
.
nodeValue
return
dom
.
childNodes
[
0
]
.
nodeValue
.
strip
()
def
find_in_page
(
self
,
page
,
starts
,
stop
):
def
find_in_page
(
self
,
page
,
starts
,
stop
):
""" Replace this with find_in_dom ?
""" Replace this with find_in_dom ?
...
@@ -109,7 +109,7 @@ class TestCAS(unittest.TestCase):
...
@@ -109,7 +109,7 @@ class TestCAS(unittest.TestCase):
start
=
end
+
page
[
end
:]
.
find
(
starts
[
1
])
+
len
(
starts
[
1
])
start
=
end
+
page
[
end
:]
.
find
(
starts
[
1
])
+
len
(
starts
[
1
])
end
=
start
+
page
[
start
:]
.
find
(
stop
)
end
=
start
+
page
[
start
:]
.
find
(
stop
)
found
=
page
[
start
:
end
]
found
=
page
[
start
:
end
]
return
found
return
found
.
strip
()
def
login
(
self
):
def
login
(
self
):
""" Login to CAS server """
""" Login to CAS server """
...
@@ -150,6 +150,7 @@ class TestCAS(unittest.TestCase):
...
@@ -150,6 +150,7 @@ class TestCAS(unittest.TestCase):
""" Use login ticket to get proxy iou """
""" Use login ticket to get proxy iou """
url_args
=
(
CAS_SERVER_URL
,
self
.
ticket
,
APP_URL
,
PROXY_URL
)
url_args
=
(
CAS_SERVER_URL
,
self
.
ticket
,
APP_URL
,
PROXY_URL
)
url
=
'
%
s/serviceValidate?ticket=
%
s&service=
%
s&pgtUrl=
%
s'
%
url_args
url
=
'
%
s/serviceValidate?ticket=
%
s&service=
%
s&pgtUrl=
%
s'
%
url_args
return
url
try
:
try
:
iou
=
self
.
opener
.
open
(
url
)
iou
=
self
.
opener
.
open
(
url
)
except
:
except
:
...
@@ -162,13 +163,14 @@ class TestCAS(unittest.TestCase):
...
@@ -162,13 +163,14 @@ class TestCAS(unittest.TestCase):
if
iou_ticket
:
if
iou_ticket
:
return
iou_ticket
return
iou_ticket
else
:
else
:
return
'FAIL: PGIOU Empty response
'
return
'FAIL: PGIOU Empty response
from
%
s'
%
url
else
:
else
:
return
'FAIL: PGIOU Response failed authentication'
return
'FAIL: PGIOU Response failed authentication'
return
None
return
None
def
get_proxy
(
self
,
iou
):
def
get_proxy
(
self
,
iou
):
""" Use login ticket to get proxy """
""" Use login ticket to get proxy """
return
url_args
=
(
PROXY_URL
,
iou
)
url_args
=
(
PROXY_URL
,
iou
)
url
=
'
%
s/pgtCallback?pgtIou=
%
s'
%
url_args
url
=
'
%
s/pgtCallback?pgtIou=
%
s'
%
url_args
try
:
try
:
...
...
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