khalidmammadov commented on a change in pull request #18961:
URL: https://github.com/apache/airflow/pull/18961#discussion_r731739464
##########
File path: tests/www/test_security.py
##########
@@ -78,629 +77,745 @@ def some_action(self):
return "action!"
-class TestSecurity(unittest.TestCase):
- @classmethod
- def setUpClass(cls):
- settings.configure_orm()
- cls.session = settings.Session
- cls.app = application.create_app(testing=True)
- cls.appbuilder = cls.app.appbuilder
- cls.app.config['WTF_CSRF_ENABLED'] = False
- cls.security_manager = cls.appbuilder.sm
- cls.delete_roles()
-
- def setUp(self):
- clear_db_runs()
- clear_db_dags()
- self.db = SQLA(self.app)
- self.appbuilder.add_view(SomeBaseView, "SomeBaseView",
category="BaseViews")
- self.appbuilder.add_view(SomeModelView, "SomeModelView",
category="ModelViews")
-
- log.debug("Complete setup!")
-
- @classmethod
- def delete_roles(cls):
- for role_name in [
- 'team-a',
- 'MyRole1',
- 'MyRole5',
- 'Test_Role',
- 'MyRole3',
- 'MyRole2',
- 'dag_permission_role',
- ]:
- api_connexion_utils.delete_role(cls.app, role_name)
-
- def expect_user_is_in_role(self, user, rolename):
- self.security_manager.bulk_sync_roles([{'role': rolename, 'perms':
[]}])
- role = self.security_manager.find_role(rolename)
+def _clear_db():
+ clear_db_runs()
+ clear_db_dags()
Review comment:
Renamed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]