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
03e1e79b
Commit
03e1e79b
authored
Nov 29, 2010
by
Ed Crewe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user add dom
parent
5f46e707
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletions
+13
-1
django_cas/tests/cas_tests.py
+13
-1
No files found.
django_cas/tests/cas_tests.py
View file @
03e1e79b
...
...
@@ -53,8 +53,20 @@ def get_ticket(page, app_url):
starts
=
[
app_url
,
'?ticket='
]
return
find_in_page
(
page
,
starts
,
'"'
)
def
find_in_dom
(
page
,
top
,
parent
,
child
):
""" Use dom to get values from page """
from
xml.dom
import
minidom
dom
=
minidom
.
parseString
(
page
)
topdom
=
dom
.
getElementsByTagname
(
top
)[
0
]
return
dom
.
getElementsByTagname
(
parent
)[
0
]
.
getElementsByTagname
(
child
)[
0
]
.
getAttribute
(
'data'
)
def
find_in_page
(
page
,
starts
,
stop
):
""" make this less ugly and more generic with regex """
""" Replace this with find_in_dom ?
Although without knowing the CAS login page this
is probably more generic.
"""
end
=
page
.
find
(
starts
[
0
])
start
=
end
+
page
[
end
:]
.
find
(
starts
[
1
])
+
len
(
starts
[
1
])
end
=
start
+
page
[
start
:]
.
find
(
stop
)
...
...
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