Horizon's tests are failing with python3.8

Bug #1854019 reported by Michal Arbet
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Michal Arbet

Bug Description

Hi,

Horizon's tests are failing with python3.8, see below :

+ http_proxy=127.0.0.1:9 https_proxy=127.0.0.9:9 HTTP_PROXY=127.0.0.1:9 HTTPS_PROXY=127.0.0.1:9 PYTHONPATH=/<<PKGBUILDDIR>>/debian/tmp/usr/lib/python3/dist-packages PYTHON=python3.8 python3.8 -m coverage run /<<PKGBUILDDIR>>/manage.py test horizon --verbosity 2 --settings=horizon.test.settings --exclude-tag selenium --exclude-tag integration
/usr/lib/python3/dist-packages/scss/selector.py:26: FutureWarning: Possible nested set at position 329
  SELECTOR_TOKENIZER = re.compile(r'''
Creating test database for alias 'default' ('file:memorydb_default?mode=memory&cache=shared')...
test_legacychoicefield_title (horizon.test.unit.forms.test_fields.ChoiceFieldTests) ... ok
.
.
.
.
.
test_call_functions_parallel_with_kwargs (openstack_dashboard.test.unit.utils.test_futurist_utils.FuturistUtilsTests) ... ok

======================================================================
ERROR: test_detail_invalid_port_range (openstack_dashboard.dashboards.project.security_groups.tests.SecurityGroupsViewTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/openstack_dashboard/test/helpers.py", line 130, in wrapped
    return function(inst, *args, **kwargs)
  File "/<<PKGBUILDDIR>>/openstack_dashboard/dashboards/project/security_groups/tests.py", line 621, in test_detail_invalid_port_range
    self.assertContains(res, cgi.escape('"from" port number is invalid',
AttributeError: module 'cgi' has no attribute 'escape'

----------------------------------------------------------------------
Ran 1522 tests in 448.635s

FAILED (errors=1)

Changed in horizon:
assignee: nobody → Michal Arbet (michalarbet)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.opendev.org/696067

Changed in horizon:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.opendev.org/696067
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=33fe0fef334ace8b19f1aad78602bb1903806892
Submitter: Zuul
Branch: master

commit 33fe0fef334ace8b19f1aad78602bb1903806892
Author: Michal Arbet <email address hidden>
Date: Tue Nov 26 12:15:40 2019 +0100

    Fix failing tests under python3.8

    In python3.8 cgi.escape function was removed as it is
    noted here : https://docs.python.org/3/whatsnew/3.8.html

    This patch is fixing security_groups tests and replacing
    escape func from cgi to escape func from django.utils.html.

    Change-Id: I5e47001dad730b64d4914e72df7d93ee15a1db12
    Closes-Bug: #1854019

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 17.1.0

This issue was fixed in the openstack/horizon 17.1.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.