Repository :
http://git.fedorahosted.org/cgit/copr.git
On branch : frontend-python3
---------------------------------------------------------------
commit c8822b855fb6947d3b095294b8bad34f794a7d44
Author: Jakub Kadlčík <jkadlcik(a)redhat.com>
Date: Tue Sep 29 12:29:26 2015 +0200
[frontend] more py2/py3 compatibile strings magic
---------------------------------------------------------------
.../test_views/test_coprs_ns/test_coprs_builds.py | 4 ++--
.../test_views/test_coprs_ns/test_coprs_general.py | 14 +++++++-------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/frontend/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_builds.py
b/frontend/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_builds.py
index 2fa1290..02ef73a 100644
--- a/frontend/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_builds.py
+++ b/frontend/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_builds.py
@@ -236,7 +236,7 @@ class TestCoprRepeatBuild(CoprsTestCase):
assert r.status_code == 200
# no longer using URL
#assert self.b_few_chroots.pkgs in r.data
- assert b"Resubmit build {}".format(self.b_few_chroots.id) in r.data
+ assert "Resubmit build
{}".format(self.b_few_chroots.id).encode("utf-8") in r.data
# TODO: maybe test, that only failed chroots are selected
@@ -264,7 +264,7 @@ class TestCoprRepeatBuild(CoprsTestCase):
data={},
follow_redirects=True)
- assert b"Resubmit build {}".format(self.b1.id) in r.data
+ assert "Resubmit build {}".format(self.b1.id).encode("utf-8")
in r.data
assert r.status_code == 200
# assert "Build was resubmitted" in r.data
# assert len(self.models.Build.query
diff --git a/frontend/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_general.py
b/frontend/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_general.py
index ca0ab85..e34e971 100644
--- a/frontend/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_general.py
+++ b/frontend/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_general.py
@@ -100,7 +100,7 @@ class TestCoprNew(CoprsTestCase):
assert self.models.Copr.query.filter(
self.models.Copr.name == "foo").first()
- assert self.success_string in r.data
+ assert self.success_string.encode("utf-8") in r.data
# make sure no initial build was submitted
assert self.models.Build.query.first() is None
@@ -124,7 +124,7 @@ class TestCoprNew(CoprsTestCase):
assert len(self.models.Copr.query.filter(
self.models.Copr.name == self.c1.name).all()) == foocoprs + 1
- assert self.success_string in r.data
+ assert self.success_string.encode("utf-8") in r.data
@TransactionDecorator("u1")
def test_copr_new_exists_for_this_user(self, f_users, f_coprs,
@@ -159,7 +159,7 @@ class TestCoprNew(CoprsTestCase):
copr = self.models.Copr.query.filter(
self.models.Copr.name == "foo").first()
assert copr
- assert self.success_string in r.data
+ assert self.success_string.encode("utf-8") in r.data
assert self.models.Build.query.first().copr == copr
assert self.models.Build.query.first().enable_net is True
@@ -181,7 +181,7 @@ class TestCoprNew(CoprsTestCase):
copr = self.models.Copr.query.filter(
self.models.Copr.name == "foo").first()
assert copr
- assert self.success_string in r.data
+ assert self.success_string.encode("utf-8") in r.data
assert self.models.Build.query.first().copr == copr
assert self.models.Build.query.first().enable_net is False
@@ -210,7 +210,7 @@ class TestCoprNew(CoprsTestCase):
self.c1.name)
.filter(self.models.Copr.owner == self.u1)
.all()) == 2
- assert self.success_string in r.data
+ assert self.success_string.encode("utf-8") in r.data
class TestCoprDetail(CoprsTestCase):
@@ -292,8 +292,8 @@ class TestCoprEdit(CoprsTestCase):
# TODO: use some kind of html parsing library to look
# for the hidden input, this ties us
# to the precise format of the tag
- assert (b'<input hidden id="id" name="id"
type="hidden" value="{0}">'
- .format(self.c1.id) in r.data)
+ assert ('<input hidden id="id" name="id"
type="hidden" value="{0}">'
+ .format(self.c1.id).encode("utf-8") in r.data)
class TestCoprUpdate(CoprsTestCase):