def test_get_view_content(self):
        r = test_backoffice.api_get_view(RequestWithViewParams({'view_slug': 'simple'}, self.user))
        self.assertEqual(r['slug'], 'simple')
        self.assertGreater(len(r['content']), 0)

        r = test_backoffice.api_get_view(RequestWithViewParams({'view_slug': 'post'}, self.user))
        self.assertEqual(r['extra'], True)
    def test_get_view_content(self):
        r = test_backoffice.api_get_view(
            RequestWithViewParams({'view_slug': 'simple'}, self.user))
        self.assertEqual(r['slug'], 'simple')
        self.assertGreater(len(r['content']), 0)

        r = test_backoffice.api_get_view(
            RequestWithViewParams({'view_slug': 'post'}, self.user))
        self.assertEqual(r['extra'], True)
 def test_get_permission(self):
     r = test_backoffice.api_get_view(
         RequestWithViewParams({'view_slug': 'permission'}, self.user2))
     self.assertEqual(r['content'], '')
 def test_non_existing_view_slug(self):
     r = test_backoffice.api_get_view(
         RequestWithViewParams({'view_slug': 'nonexisting'}, self.user))
     self.assertIn('View with slug "nonexisting" does not exist.',
                   r['content'])
 def test_get_permission(self):
     r = test_backoffice.api_get_view(RequestWithViewParams({'view_slug': 'permission'}, self.user2))
     self.assertEqual(r['content'], '')
 def test_non_existing_view_slug(self):
     r = test_backoffice.api_get_view(RequestWithViewParams({'view_slug': 'nonexisting'}, self.user))
     self.assertIn('View with slug "nonexisting" does not exist.', r['content'])