Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
9508a471
Commit
9508a471
authored
Feb 13, 2016
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use BytesIO instead of StringIO
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
538eac74
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
weblate/accounts/captcha.py
weblate/accounts/captcha.py
+2
-1
weblate/trans/tests/test_views.py
weblate/trans/tests/test_views.py
+2
-2
No files found.
weblate/accounts/captcha.py
View file @
9508a471
...
...
@@ -137,7 +137,8 @@ def checksum_question(question, timestamp):
'''
Returns checksum for a question.
'''
sha
=
hashlib
.
sha1
(
settings
.
SECRET_KEY
+
question
+
timestamp
)
challenge
=
''
.
join
((
settings
.
SECRET_KEY
,
question
,
timestamp
))
sha
=
hashlib
.
sha1
(
challenge
.
encode
(
'utf-8'
))
return
sha
.
hexdigest
()
...
...
weblate/trans/tests/test_views.py
View file @
9508a471
...
...
@@ -23,9 +23,9 @@ Tests for translation views.
"""
from
xml.dom
import
minidom
from
io
import
BytesIO
from
six.moves.urllib.parse
import
urlsplit
from
six
import
StringIO
from
django.test.client
import
RequestFactory
from
django.contrib.auth.models
import
Group
,
User
...
...
@@ -182,7 +182,7 @@ class ViewTestCase(RepoTestCase):
def
assertPNGData
(
self
,
content
):
"""Checks whether data is PNG image"""
# Try to load PNG with PIL
image
=
Image
.
open
(
String
IO
(
content
))
image
=
Image
.
open
(
Bytes
IO
(
content
))
self
.
assertEqual
(
image
.
format
,
'PNG'
)
def
assertSVG
(
self
,
response
):
...
...
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