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): ...@@ -217,7 +217,10 @@ class SearchViewTest(ViewTestCase):
'Substring search for' 'Substring search for'
) )
# Extract search ID # 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 # Try access to pages
response = self.client.get( response = self.client.get(
self.translate_url, self.translate_url,
...@@ -285,7 +288,10 @@ class SearchViewTest(ViewTestCase): ...@@ -285,7 +288,10 @@ class SearchViewTest(ViewTestCase):
'Substring search for', 'Substring search for',
url=translation.get_translate_url() 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( response = self.client.get(
self.translate_url, self.translate_url,
{'sid': search_id, 'offset': 0} {'sid': search_id, 'offset': 0}
...@@ -304,7 +310,10 @@ class SearchViewTest(ViewTestCase): ...@@ -304,7 +310,10 @@ class SearchViewTest(ViewTestCase):
'3 / 4' '3 / 4'
) )
# Extract search ID # 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 # Navigation
response = self.do_search( response = self.do_search(
{'sid': search_id, 'offset': 0}, {'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