Don't escape full_path in containers panel in Django 1.8

Bug #1482958 reported by Lin Hua Cheng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Lin Hua Cheng

Bug Description

In Django 1.8, request.get_full_path is now escaped. we don't need additional escape call.

This result to test failure for containers since the url is escaped twice:

======================================================================
FAIL: test_delete (openstack_dashboard.dashboards.project.containers.tests.SwiftTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/lin-hua-cheng/Documents/workspace/horizon/openstack_dashboard/test/helpers.py", line 110, in instance_stub_out
    return fn(self, *args, **kwargs)
  File "/home/lin-hua-cheng/Documents/workspace/horizon/openstack_dashboard/dashboards/project/containers/tests.py", line 311, in test_delete
    self.assertEqual(handled['location'], index_url)
AssertionError: '/project/containers/container%2520one%2525%25E6%258D%2586/' != u'/project/containers/container%20one%25%E6%8D%86/'
    "'/project/containers/container%2520one%2525%25E6%258D%2586/' != u'/project/containers/container%20one%25%E6%8D%86/'" = '%s != %s' % (safe_repr('/project/containers/container%2520one%2525%25E6%258D%2586/'), safe_repr(u'/project/containers/container%20one%25%E6%8D%86/'))
    "'/project/containers/container%2520one%2525%25E6%258D%2586/' != u'/project/containers/container%20one%25%E6%8D%86/'" = self._formatMessage("'/project/containers/container%2520one%2525%25E6%258D%2586/' != u'/project/containers/container%20one%25%E6%8D%86/'", "'/project/containers/container%2520one%2525%25E6%258D%2586/' != u'/project/containers/container%20one%25%E6%8D%86/'")
>> raise self.failureException("'/project/containers/container%2520one%2525%25E6%258D%2586/' != u'/project/containers/container%20one%25%E6%8D%86/'")

======================================================================
FAIL: test_delete_pseudo_folder (openstack_dashboard.dashboards.project.containers.tests.SwiftTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/lin-hua-cheng/Documents/workspace/horizon/openstack_dashboard/test/helpers.py", line 110, in instance_stub_out
    return fn(self, *args, **kwargs)
  File "/home/lin-hua-cheng/Documents/workspace/horizon/openstack_dashboard/dashboards/project/containers/tests.py", line 331, in test_delete_pseudo_folder
    self.assertEqual(handled['location'], index_url)
AssertionError: '/project/containers/container%2520one%2525%25E6%258D%2586/' != u'/project/containers/container%20one%25%E6%8D%86/'
    "'/project/containers/container%2520one%2525%25E6%258D%2586/' != u'/project/containers/container%20one%25%E6%8D%86/'" = '%s != %s' % (safe_repr('/project/containers/container%2520one%2525%25E6%258D%2586/'), safe_repr(u'/project/containers/container%20one%25%E6%8D%86/'))
    "'/project/containers/container%2520one%2525%25E6%258D%2586/' != u'/project/containers/container%20one%25%E6%8D%86/'" = self._formatMessage("'/project/containers/container%2520one%2525%25E6%258D%2586/' != u'/project/containers/container%20one%25%E6%8D%86/'", "'/project/containers/container%2520one%2525%25E6%258D%2586/' != u'/project/containers/container%20one%25%E6%8D%86/'")
>> raise self.failureException("'/project/containers/container%2520one%2525%25E6%258D%2586/' != u'/project/containers/container%20one%25%E6%8D%86/'")

======================================================================
FAIL: test_index_container_selected (openstack_dashboard.dashboards.project.containers.tests.SwiftTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/lin-hua-cheng/Documents/workspace/horizon/openstack_dashboard/test/helpers.py", line 110, in instance_stub_out
    return fn(self, *args, **kwargs)
  File "/home/lin-hua-cheng/Documents/workspace/horizon/openstack_dashboard/dashboards/project/containers/tests.py", line 195, in test_index_container_selected
    self.assertContains(res, form_action, count=2)
  File "/home/lin-hua-cheng/Documents/workspace/horizon/.venv/local/lib/python2.7/site-packages/django/test/testcases.py", line 355, in assertContains
    " (expected %d)" % (real_count, text_repr, count))
AssertionError: Found 0 instances of ' action="/project/containers/container%20one%25%E6%8D%86/" ' in response (expected 2)
    '0 != 2' = '%s != %s' % (safe_repr(0), safe_repr(2))
    u'Found 0 instances of \' action="/project/containers/container%20one%25%E6%8D%86/" \' in response (expected 2)' = self._formatMessage(u'Found 0 instances of \' action="/project/containers/container%20one%25%E6%8D%86/" \' in response (expected 2)', '0 != 2')
>> raise self.failureException(u'Found 0 instances of \' action="/project/containers/container%20one%25%E6%8D%86/" \' in response (expected 2)')

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/210805

Changed in horizon:
assignee: nobody → Lin Hua Cheng (lin-hua-cheng)
status: New → In Progress
description: updated
Changed in horizon:
importance: Undecided → Medium
milestone: none → liberty-3
importance: Medium → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/210805
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=7b4b527dc4042f10d51f2d93dc1707ffefa6902a
Submitter: Jenkins
Branch: master

commit 7b4b527dc4042f10d51f2d93dc1707ffefa6902a
Author: lin-hua-cheng <email address hidden>
Date: Sun Aug 9 00:52:31 2015 -0700

    Don't escape request.get_full_path() in Django1.8

    In Django1.8, request.get_full_path() method now escapes
    unsafe characters.

    Disable the urlquote for containers table when running
    in Django1.8.

    Closes-Bug: #1482958
    Partially Implements: blueprint django18

    Change-Id: I4b2051942618ec3b9262a26e2027f17ecb589eb8

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: liberty-3 → 8.0.0
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.