Ejemplo n.º 1
0
 def test_has_permission_no(self, mock_app):
     request = self.request_factory
     self.user.has_perm = mock.MagicMock(return_value=False)
     request.user = self.user
     mock_app.return_value = mock.MagicMock(package='test_package')
     result = tethys_permission.has_permission(request=request, perm='test_perm')
     self.assertFalse(result)
Ejemplo n.º 2
0
 def test_has_permission_no(self, mock_app):
     request = self.request_factory
     self.user.has_perm = mock.MagicMock(return_value=False)
     request.user = self.user
     mock_app.return_value = mock.MagicMock(package='test_package')
     result = tethys_permission.has_permission(request=request,
                                               perm='test_perm')
     self.assertFalse(result)