示例#1
0
 def test_initialize_roles_staticmethod(self):
     Role.initialize_roles()
     admin_role = Role.query.filter_by(name='Admin').first()
     super_admin_role = Role.query.filter_by(name='Super Admin').first()
     user_role = Role.query.filter_by(name='User').first()
     self.assertTrue(admin_role is not None)
     self.assertTrue(super_admin_role is not None)
     self.assertTrue(user_role is not None)
示例#2
0
 def setUp(self):
     db.drop_all()
     db.create_all()
     AppPermission.initialize_app_permissions()
     Role.initialize_roles()
     self.client = self.app.test_client(use_cookies=True)