Commit a4f09631 authored by Michal Čihař's avatar Michal Čihař

Fix search view tests for Python 3

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 6437c484
......@@ -217,7 +217,10 @@ class SearchViewTest(ViewTestCase):
'Substring search for'
)
# Extract search ID
search_id = re.findall(r'sid=([0-9a-f-]*)&amp', response.content)[0]
search_id = re.findall(
r'sid=([0-9a-f-]*)&amp',
response.content.decode('utf-8')
)[0]
# Try access to pages
response = self.client.get(
self.translate_url,
......@@ -285,7 +288,10 @@ class SearchViewTest(ViewTestCase):
'Substring search for',
url=translation.get_translate_url()
)
search_id = re.findall(r'sid=([0-9a-f-]*)&amp', response.content)[0]
search_id = re.findall(
r'sid=([0-9a-f-]*)&amp',
response.content.decode('utf-8')
)[0]
response = self.client.get(
self.translate_url,
{'sid': search_id, 'offset': 0}
......@@ -304,7 +310,10 @@ class SearchViewTest(ViewTestCase):
'3 / 4'
)
# Extract search ID
search_id = re.findall(r'sid=([0-9a-f-]*)&amp', response.content)[0]
search_id = re.findall(
r'sid=([0-9a-f-]*)&amp',
response.content.decode('utf-8')
)[0]
# Navigation
response = self.do_search(
{'sid': search_id, 'offset': 0},
......
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