~ubuntu-branches/ubuntu/trusty/horizon/trusty-updates

« back to all changes in this revision

Viewing changes to openstack_dashboard/dashboards/admin/images/tests.py

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman
  • Date: 2013-09-06 11:59:43 UTC
  • mfrom: (1.1.30)
  • Revision ID: package-import@ubuntu.com-20130906115943-h3td0l7tp16mb9oc
Tags: 1:2013.2~b3-0ubuntu1
* New upstream release.
* debian/control: Minimum python-openstack-auth version >= 1.1.1.
* debian/control: Add python-troveclient.
* debian/static: Refresh static assets for 2013.2~b3.
* debian/patches: ubuntu_local_settings.patch -> ubuntu_settings.patch, also
  patch location of secret key in openstack_dashboard/settings.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
#    License for the specific language governing permissions and limitations
15
15
#    under the License.
16
16
 
17
 
from django.conf import settings
18
 
from django.core.urlresolvers import reverse
 
17
from django.conf import settings  # noqa
 
18
from django.core.urlresolvers import reverse  # noqa
19
19
from django import http
20
 
from django.test.utils import override_settings
 
20
from django.test.utils import override_settings  # noqa
21
21
 
22
 
from mox import IsA
 
22
from mox import IsA  # noqa
23
23
 
24
24
from openstack_dashboard import api
25
25
from openstack_dashboard.test import helpers as test
26
26
 
27
 
from openstack_dashboard.dashboards.admin.images.tables import AdminImagesTable
 
27
from openstack_dashboard.dashboards.admin.images import tables
28
28
 
29
29
 
30
30
class ImageCreateViewTest(test.BaseAdminViewTests):
90
90
                         settings.API_RESULT_PAGE_SIZE)
91
91
 
92
92
        url = "?".join([reverse('horizon:admin:images:index'),
93
 
                        "=".join([AdminImagesTable._meta.pagination_param,
94
 
                                  images[2].id])])
 
93
                    "=".join([tables.AdminImagesTable._meta.pagination_param,
 
94
                              images[2].id])])
95
95
        res = self.client.get(url)
96
96
        # get second page (items 2-4)
97
97
        self.assertEqual(len(res.context['images_table'].data),
98
98
                         settings.API_RESULT_PAGE_SIZE)
99
99
 
100
100
        url = "?".join([reverse('horizon:admin:images:index'),
101
 
                        "=".join([AdminImagesTable._meta.pagination_param,
102
 
                                  images[4].id])])
 
101
                    "=".join([tables.AdminImagesTable._meta.pagination_param,
 
102
                              images[4].id])])
103
103
        res = self.client.get(url)
104
104
        # get third page (item 5)
105
105
        self.assertEqual(len(res.context['images_table'].data),