Re-enable failing test

One database backup test was failing due to a Horizon change which
made the Angular Swift panel the default panel.  Consequently,
the Django urls are not available.

The Trove database backup table has an action to download the backup
from Swift and the test would fail with an unresolved URL.

Added code to account for whether the legacy or angular version of
the Swift panel is being used to control whether the download
action is available.

Also re-enabled the failing test.

Change-Id: I5b34db1022b9db3bf6ad93cc7824b0c257482ad4
Closes-Bug: #1559379
This commit is contained in:
Duk Loi 2016-03-22 13:53:09 -04:00
parent 52ae94844e
commit e23960a72e
2 changed files with 3 additions and 3 deletions

View File

@ -12,6 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from django.conf import settings
from django.core.urlresolvers import reverse
from django.template import defaultfilters as d_filters
from django.utils.translation import pgettext_lazy
@ -86,7 +87,8 @@ class DownloadBackup(tables.LinkAction):
'object_path': object_path})
def allowed(self, request, datum):
return datum.status == 'COMPLETED'
return ((settings.HORIZON_CONFIG['swift_panel'] == 'legacy') and
datum.status == 'COMPLETED')
class DeleteBackup(tables.DeleteAction):

View File

@ -16,7 +16,6 @@ from django.core.urlresolvers import reverse
from django import http
from mox3.mox import IsA # noqa
import six
import unittest
from trove_dashboard import api
from trove_dashboard.test import helpers as test
@ -27,7 +26,6 @@ DETAILS_URL = reverse('horizon:project:database_backups:detail', args=['id'])
class DatabasesBackupsTests(test.TestCase):
@unittest.skip
@test.create_stubs({api.trove: ('backup_list', 'instance_get')})
def test_index(self):
api.trove.backup_list(IsA(http.HttpRequest))\