summaryrefslogtreecommitdiff
path: root/tests/mach2_test.py
diff options
context:
space:
mode:
authorMichaël Ball <michael.ball@gmail.com>2017-03-26 10:19:59 +0100
committerMichaël Ball <michael.ball@gmail.com>2017-06-04 07:37:53 +0100
commitd06f96388d754ed41876f7fccb63f84241d44963 (patch)
tree640a4f3eaf7e1f2b76a246a1977c27775d0b59a1 /tests/mach2_test.py
parentcaa1c3ccdf94ee20140b3964aab0ad3058e03699 (diff)
Works on python 2/pypy
Diffstat (limited to 'tests/mach2_test.py')
-rw-r--r--tests/mach2_test.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/mach2_test.py b/tests/mach2_test.py
index c45ff2a..c33fd92 100644
--- a/tests/mach2_test.py
+++ b/tests/mach2_test.py
@@ -2,6 +2,7 @@ import json
import unittest
import pytest
+import six
from mach2 import create_app
@@ -25,17 +26,17 @@ class Mach2TestCase(unittest.TestCase):
def test_login(self):
rv = self.login("admin", "testpass")
- assert bytes("Log out", "utf-8") in rv.data
+ assert six.b("Log out") in rv.data
self.logout()
rv = self.login("wrong", "definitelywrong")
- assert bytes("Log out", "utf-8") not in rv.data
+ assert six.b("Log out") not in rv.data
self.logout()
def test_album(self):
self.login("admin", "testpass")
rv = self.app.get("/albums/1")
- assert bytes("Album 1", "utf-8") in rv.data
+ assert six.b("Album 1") in rv.data
self.logout()
@@ -43,8 +44,8 @@ class Mach2TestCase(unittest.TestCase):
self.login("admin", "testpass")
rv = self.app.get("/artists")
- assert bytes("Artist 1", "utf-8") in rv.data
- assert bytes("Artist 2", "utf-8") in rv.data
+ assert six.b("Artist 1") in rv.data
+ assert six.b("Artist 2") in rv.data
artists = json.loads(rv.data.decode("utf-8"))
assert artists