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
cefed8f9
Commit
cefed8f9
authored
Jan 14, 2015
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test mixing search id from other language
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
032706cc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
5 deletions
+26
-5
weblate/trans/tests/test_search.py
weblate/trans/tests/test_search.py
+26
-5
No files found.
weblate/trans/tests/test_search.py
View file @
cefed8f9
...
...
@@ -35,14 +35,13 @@ class SearchViewTest(ViewTestCase):
)
self
.
translate_url
=
self
.
translation
.
get_translate_url
()
def
do_search
(
self
,
params
,
expected
):
def
do_search
(
self
,
params
,
expected
,
url
=
None
):
'''
Helper method for performing search test.
'''
response
=
self
.
client
.
get
(
self
.
translate_url
,
params
,
)
if
url
is
None
:
url
=
self
.
translate_url
response
=
self
.
client
.
get
(
url
,
params
)
if
expected
is
None
:
self
.
assertRedirects
(
response
,
...
...
@@ -177,6 +176,28 @@ class SearchViewTest(ViewTestCase):
self
.
translation
.
get_absolute_url
()
)
def
test_mixed_sid
(
self
):
"""
Tests using SID from other translation.
"""
translation
=
self
.
subproject
.
translation_set
.
get
(
language_code
=
'de'
)
response
=
self
.
do_search
(
{
'q'
:
'Weblate'
,
'search'
:
'substring'
},
'Substring search for'
,
url
=
translation
.
get_translate_url
()
)
search_id
=
re
.
findall
(
r'sid=([0-9a-f-]*)&'
,
response
.
content
)[
0
]
response
=
self
.
client
.
get
(
self
.
translate_url
,
{
'sid'
:
search_id
,
'offset'
:
0
}
)
self
.
assertRedirects
(
response
,
self
.
translation
.
get_absolute_url
()
)
def
test_seach_checksum
(
self
):
unit
=
self
.
translation
.
unit_set
.
get
(
source
=
'Try Weblate at <http://demo.weblate.org/>!
\
n
'
...
...
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