Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
a268f327
Commit
a268f327
authored
Feb 10, 2014
by
Sofia Papagiannaki
Browse files
astakos oa2: Fix further unicode issues
parent
cab39ed2
Changes
2
Hide whitespace changes
Inline
Side-by-side
snf-astakos-app/astakos/oa2/backends/djangobackend.py
View file @
a268f327
...
...
@@ -46,6 +46,7 @@ from django.http import HttpResponseNotAllowed
from
django.views.decorators.csrf
import
csrf_exempt
from
synnefo.lib
import
join_urls
from
synnefo.util.text
import
uenc
import
logging
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -120,7 +121,7 @@ class DjangoBackend(DjangoBackendORMMixin, oa2base.SimpleBackend,
response
.
status_code
=
oa2response
.
status
response
.
content
=
oa2response
.
body
for
key
,
value
in
oa2response
.
headers
.
iteritems
():
response
[
key
]
=
value
response
[
uenc
(
key
)
]
=
uenc
(
value
)
return
response
def
build_request
(
self
,
django_request
):
...
...
snf-astakos-app/astakos/oa2/tests/djangobackend.py
View file @
a268f327
...
...
@@ -105,7 +105,7 @@ class URLAssertionsMixin(object):
@
parsed_url_wrapper
def
assertPath
(
self
,
url
,
path
):
self
.
assertEqual
(
url
.
path
,
path
)
self
.
assertEqual
(
normalize
(
url
.
path
)
,
normalize
(
path
)
)
@
parsed_url_wrapper
def
assertSecure
(
self
,
url
,
key
):
...
...
@@ -385,7 +385,7 @@ class TestOA2(TestCase, URLAssertionsMixin):
self
.
assertEqual
(
code
.
redirect_uri
,
self
.
client3_redirect_uri
)
# redirect uri startswith the client's registered redirect url
params
[
'redirect_uri'
]
=
'%s
more
'
%
self
.
client3_redirect_uri
params
[
'redirect_uri'
]
=
'%s
φωτογραφία.JPG
'
%
self
.
client3_redirect_uri
self
.
client
.
set_credentials
(
'client3'
,
'secret'
)
r
=
self
.
client
.
authorize_code
(
'client3'
,
urlparams
=
params
)
self
.
assertEqual
(
r
.
status_code
,
400
)
...
...
@@ -419,7 +419,7 @@ class TestOA2(TestCase, URLAssertionsMixin):
self
.
assertEqual
(
r
.
status_code
,
400
)
# redirect uri descendant
redirect_uri
=
'%s/
more
?α=γιουνικοντ'
%
self
.
client3_redirect_uri
redirect_uri
=
'%s/
φωτογραφία.JPG
?α=γιουνικοντ'
%
self
.
client3_redirect_uri
params
[
'redirect_uri'
]
=
redirect_uri
self
.
client
.
set_credentials
(
'client3'
,
'secret'
)
r
=
self
.
client
.
authorize_code
(
'client3'
,
urlparams
=
params
)
...
...
@@ -553,7 +553,7 @@ class TestOA2(TestCase, URLAssertionsMixin):
'state'
:
None
}
self
.
assert_access_token_response
(
r
,
expected
)
redirect_uri
=
'%s/
more
?α=γιουνικοντ'
%
self
.
client3_redirect_uri
redirect_uri
=
'%s/
φωτογραφία.JPG
?α=γιουνικοντ'
%
self
.
client3_redirect_uri
params
=
{
'redirect_uri'
:
redirect_uri
}
r
=
self
.
client
.
authorize_code
(
'client3'
,
urlparams
=
params
)
self
.
assertCount
(
AuthorizationCode
,
1
)
...
...
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