Commit 7b755ad3 authored by Jelle van der Waa's avatar Jelle van der Waa 🚧
Browse files

Fix tests for Python3 by decoding byte

parent 629b12da
......@@ -77,4 +77,4 @@ def testSendAnnounce(self):
def testPreview(self):
response = self.client.post('/news/preview/', {'data': '**body**'}, follow=True)
self.assertEqual(response.status_code, 200)
self.assertEqual('<p><strong>body</strong></p>', response.content)
self.assertEqual('<p><strong>body</strong></p>', response.content.decode())
......@@ -170,7 +170,7 @@ def test_filter_packager_unknown(self):
def test_sort(self):
response = self.client.get('/packages/?sort=pkgname')
self.assertEqual(response.status_code, 200)
self.assertIn('5 matching packages found', response.content)
self.assertIn('5 matching packages found', response.content.decode())
def test_head(self):
response = self.client.head('/packages/?q=unknown')
......@@ -340,7 +340,7 @@ def test_adopt_package(self):
self.assertEqual(len(PackageRelation.objects.all()), 0)
def test_no_permissions(self):
self.profile.allowed_repos = []
self.profile.allowed_repos.set([])
self.profile.save()
pkg = Package.objects.first()
......@@ -352,7 +352,7 @@ def test_wrong_request(self):
pkg = Package.objects.first()
response = self.client.post('/packages/update/', {'pkgid': pkg.id, }, follow=True)
self.assertEqual(response.status_code, 200)
self.assertIn('Are you trying to adopt or disown', response.content)
self.assertIn('Are you trying to adopt or disown', response.content.decode())
def test_stale_relations(self):
response = self.client.get('/packages/stale_relations/')
......
Supports Markdown
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