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
ec11e9f9
Commit
ec11e9f9
authored
Apr 10, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test for search id browsing
parent
149dc138
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
trans/tests/views.py
trans/tests/views.py
+30
-0
No files found.
trans/tests/views.py
View file @
ec11e9f9
...
@@ -29,6 +29,7 @@ from django.contrib.messages.storage.fallback import FallbackStorage
...
@@ -29,6 +29,7 @@ from django.contrib.messages.storage.fallback import FallbackStorage
from
trans.tests.models
import
RepoTestCase
from
trans.tests.models
import
RepoTestCase
from
accounts.models
import
Profile
from
accounts.models
import
Profile
import
cairo
import
cairo
import
re
from
urlparse
import
urlsplit
from
urlparse
import
urlsplit
from
cStringIO
import
StringIO
from
cStringIO
import
StringIO
...
@@ -324,3 +325,32 @@ class SearchViewTest(ViewTestCase):
...
@@ -324,3 +325,32 @@ class SearchViewTest(ViewTestCase):
response
,
response
,
self
.
translation
.
get_absolute_url
()
self
.
translation
.
get_absolute_url
()
)
)
def
test_search_links
(
self
):
response
=
self
.
client
.
get
(
self
.
translate_url
,
{
'q'
:
'weblate'
}
)
self
.
assertContains
(
response
,
'Current filter: Fulltext search for'
)
# Extract search ID
search_id
=
re
.
findall
(
r'sid=([0-9a-f-]*)&'
,
response
.
content
)[
0
]
# Try access to pages
response
=
self
.
client
.
get
(
self
.
translate_url
,
{
'sid'
:
search_id
,
'offset'
:
0
}
)
self
.
assertContains
(
response
,
'http://demo.weblate.org/'
,
)
response
=
self
.
client
.
get
(
self
.
translate_url
,
{
'sid'
:
search_id
,
'offset'
:
1
}
)
self
.
assertContains
(
response
,
'Thank you for using Weblate.'
,
)
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