OLD | NEW |
(Empty) | |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is govered by a BSD-style |
| 3 # license that can be found in the LICENSE file or at |
| 4 # https://developers.google.com/open-source/licenses/bsd |
| 5 |
| 6 """Unittests for the issueexport servlet.""" |
| 7 |
| 8 import unittest |
| 9 |
| 10 from framework import permissions |
| 11 from services import service_manager |
| 12 from testing import testing_helpers |
| 13 from tracker import issueexport |
| 14 |
| 15 |
| 16 class IssueExportTest(unittest.TestCase): |
| 17 |
| 18 def setUp(self): |
| 19 self.services = service_manager.Services() |
| 20 self.servlet = issueexport.IssueExport( |
| 21 'req', 'res', services=self.services) |
| 22 |
| 23 def testAssertBasePermission(self): |
| 24 mr = testing_helpers.MakeMonorailRequest( |
| 25 perms=permissions.OWNER_ACTIVE_PERMISSIONSET) |
| 26 self.assertRaises(permissions.PermissionException, |
| 27 self.servlet.AssertBasePermission, mr) |
| 28 mr.auth.user_pb.is_site_admin = True |
| 29 self.servlet.AssertBasePermission(mr) |
OLD | NEW |