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

« back to all changes in this revision

Viewing changes to horizon/test/tests/base.py

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-03-06 16:53:28 UTC
  • mfrom: (1.1.37)
  • Revision ID: package-import@ubuntu.com-20140306165328-w2vgmtfriqlhp27m
Tags: 1:2014.1~b3-0ubuntu1
* New upstream milestone release.
* d/static/*: Refreshed assets for new upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
133
133
 
134
134
        # Retrieval
135
135
        my_dash_instance_by_name = horizon.get_dashboard("mydash")
136
 
        self.assertTrue(isinstance(my_dash_instance_by_name, MyDash))
 
136
        self.assertIsInstance(my_dash_instance_by_name, MyDash)
137
137
        my_dash_instance_by_class = horizon.get_dashboard(MyDash)
138
138
        self.assertEqual(my_dash_instance_by_name, my_dash_instance_by_class)
139
139
        with self.assertRaises(base.NotRegistered):
216
216
 
217
217
    def test_lazy_urls(self):
218
218
        urlpatterns = horizon.urls[0]
219
 
        self.assertTrue(isinstance(urlpatterns, base.LazyURLPattern))
 
219
        self.assertIsInstance(urlpatterns, base.LazyURLPattern)
220
220
        # The following two methods simply should not raise any exceptions
221
221
        iter(urlpatterns)
222
222
        reversed(urlpatterns)
334
334
                               base.Horizon.get_user_home(self.test_user))
335
335
 
336
336
    def test_using_module_function(self):
337
 
        module_func = 'django.utils.html.strip_tags'
 
337
        module_func = 'django.utils.encoding.force_unicode'
338
338
        settings.HORIZON_CONFIG['user_home'] = module_func
339
339
        conf.HORIZON_CONFIG._setup()
340
340
 
341
 
        self.test_user.username = '<ignore>testname<ignore>'
 
341
        self.test_user.username = 'testname'
342
342
        self.assertEqual(self.original_username,
343
343
                               base.Horizon.get_user_home(self.test_user))
344
344