Esempio n. 1
0
    def test_decorated_view(self):
        """Checks that a decorated view has a 'safe' attribute
        set to True and the same name as the original view"""

        decorated_view = utils.safe(self.undecorated_view)

        self.assertTrue(decorated_view.safe)
        self.assertEqual(decorated_view.__name__, self.undecorated_view.__name__)
Esempio n. 2
0
    def test_decorated_view(self):
        """Checks that a decorated view is marked as safe"""

        self.decorated_view = utils.safe(self.view)
        self.assertTrue(utils.is_safe(self.decorated_view, rules={}))