From dc36ac127789098cf8be0cc06ab3b97ec0e0f438 Mon Sep 17 00:00:00 2001 From: mprahl Date: Wed, 11 Mar 2020 11:32:18 -0400 Subject: [PATCH] Stop upgrading the Flask packages in the CentOS Python 2 tests container image This will ensure that the code works with the version of Flask in RHEL 7. --- docker/Dockerfile-tests | 2 +- tests/test_web/test_views.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile-tests b/docker/Dockerfile-tests index a57a78c2..74f047be 100644 --- a/docker/Dockerfile-tests +++ b/docker/Dockerfile-tests @@ -52,7 +52,7 @@ RUN yum -y install \ && yum clean all # We currently require newer versions of these Python packages for the tests. # more-itertools is required by pytest, but versions 6.0.0 and up aren't Python 2 compatible -RUN pip install --upgrade flask-sqlalchemy "pytest<5.0" flake8 tox pip "more-itertools<6.0.0" pytest-cov +RUN pip install --upgrade "pytest<5.0" flake8 tox pip "more-itertools<6.0.0" pytest-cov # Install zipp as a workaround for https://github.com/pypa/virtualenv/issues/1630 RUN pip install zipp VOLUME /src diff --git a/tests/test_web/test_views.py b/tests/test_web/test_views.py index 5d963b50..8b75868a 100644 --- a/tests/test_web/test_views.py +++ b/tests/test_web/test_views.py @@ -1269,7 +1269,7 @@ class TestViews: "/module-build-service/1/module-builds/7", data=json.dumps({"state": "failed"})) assert rv.status_code == 400 - assert rv.json == { + assert json.loads(rv.data) == { "error": "Bad Request", "message": ( "To cancel a module build, it must be in one of the following states: " @@ -1342,7 +1342,7 @@ class TestViews: "/module-build-service/1/module-builds/7", data=json.dumps({"state": "some_state"})) assert rv.status_code == 400 - assert rv.json == { + assert json.loads(rv.data) == { "error": "Bad Request", "message": "An invalid state was submitted. Valid states values are: failed, 4", "status": 400, @@ -2775,7 +2775,7 @@ class TestViews: payload = {"branch": "master", "scmurl": scm_url} if br_override: payload["buildrequire_overrides"] = br_override - rv = self.client.post(post_url, json=payload) + rv = self.client.post(post_url, data=json.dumps(payload)) data = json.loads(rv.data) mmd = load_mmd(data[0]["modulemd"])