Exemplo n.º 1
0
 def test_moderator_role(self):
     u = User(username='******',
              email='*****@*****.**',
              password='******')
     u.role_id = 2
     self.assertTrue(u.can(Permission.MODERATE))
     self.assertFalse(u.can(Permission.ADMIN))
Exemplo n.º 2
0
 def test_admin_role(self):
     u = User(username='******',
              email=f'{Config.COSTAPP_ADMIN}',
              password='******')
     self.assertEqual(u.role_id, 3)
     self.assertTrue(u.can(Permission.ADMIN))
Exemplo n.º 3
0
 def test_user_role(self):
     u = User(username='******',
              email='*****@*****.**',
              password='******')
     self.assertEqual(u.role_id, 1)
     self.assertFalse(u.can(Permission.MODERATE))