Esempio n. 1
0
 def test_所属ユーザーの権限取得が行える(self):
     trace_id = str(uuid.uuid4())
     checkauthority.check_authority(
         trace_id=trace_id,
         user_id=affiliation_template_user_id.format("registered"),
         organization_id=registered_organization_id)
     self.assertTrue(True)
Esempio n. 2
0
 def test_非所属ユーザーの権限取得時はFalseとする(self):
     trace_id = str(uuid.uuid4())
     result = checkauthority.check_authority(
         trace_id=trace_id,
         user_id=affiliation_template_user_id.format("not_belong"),
         organization_id=registered_organization_id)
     self.assertFalse(result)
Esempio n. 3
0
 def test_非所属ユーザーの権限取得時に例外が発生する(self):
     trace_id = str(uuid.uuid4())
     is_access_ok = checkauthority.check_authority(
         trace_id=trace_id,
         user_id=affiliation_template_user_id.format("not_belong"),
         organization_id=registered_organization_id,
         authority=Authority.Owner)
     self.assertEqual(is_access_ok, False)
Esempio n. 4
0
 def test_所属ユーザーの権限不足時にFalseとする(self):
     trace_id = str(uuid.uuid4())
     result = checkauthority.check_authority(
         trace_id=trace_id,
         user_id=affiliation_template_user_id.format(
             "not_enough_permission"),
         organization_id=registered_organization_id,
         authority=Authority.Owner)
     self.assertFalse(result)