Commit 45681e7c authored by Michal Čihař's avatar Michal Čihař

Test for showing translation by checksum

parent 134ec624
......@@ -557,6 +557,30 @@ class SearchViewTest(ViewTestCase):
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'
)
response = self.do_search(
{'checksum': unit.checksum},
'3 / 4'
)
# Extract search ID
search_id = re.findall(r'sid=([0-9a-f-]*)&amp', response.content)[0]
# Navigation
response = self.do_search(
{'sid': search_id, 'offset': 0},
'1 / 4'
)
response = self.do_search(
{'sid': search_id, 'offset': 3},
'4 / 4'
)
response = self.do_search(
{'sid': search_id, 'offset': 4},
None
)
def test_search_type(self):
self.do_search(
{'type': 'untranslated'},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment