← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1815285] Re: test_url_for in openstack_dashboard.test.unit.api.test_base fails if UT runs only with this module

 

Reviewed:  https://review.openstack.org/636012
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=4bf069bb9292710ed86be245c1b091b0a7a7d678
Submitter: Zuul
Branch:    master

commit 4bf069bb9292710ed86be245c1b091b0a7a7d678
Author: Akihiro Motoki <amotoki@xxxxxxxxx>
Date:   Sat Feb 9 21:12:50 2019 +0900

    Ensure to call patch_middleware_get_user() in api.test_base
    
    ApiHelperTests.test_url_for in openstack_dashboard.test.unit.api.test_base
    depends on keystone user and token information. To make this work,
    we need to call utils.patch_middleware_get_user().
    This commit changes ApiHelperTests to inherit APITestCase.
    
    Change-Id: I3848f756604262b07700a65e9be5bacd48da191f
    Closes-Bug: #1815285


** Changed in: horizon
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1815285

Title:
  test_url_for in openstack_dashboard.test.unit.api.test_base fails if
  UT runs only with this module

Status in OpenStack Dashboard (Horizon):
  Fix Released

Bug description:
  When we run openstack_dashboard.test.unit.api.test_base only,
  test_url_for fails.

  ======================================================================
  ERROR: test_url_for (openstack_dashboard.test.unit.api.test_base.ApiHelperTests)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/home/tipica/work/horizon/openstack_dashboard/test/unit/api/test_base.py", line 243, in test_url_for
      url = api_base.url_for(self.request, 'image')
    File "/home/tipica/work/horizon/openstack_dashboard/api/base.py", line 332, in url_for
      catalog = request.user.service_catalog
    File "/home/tipica/work/horizon/.tox/py27/local/lib/python2.7/site-packages/django/utils/functional.py", line 239, in inner
      return func(self._wrapped, *args)
  AttributeError: 'AnonymousUser' object has no attribute 'service_catalog'

  ----------------------------------------------------------------------
  Ran 22 tests in 0.403s

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1815285/+subscriptions


References