khalidmammadov commented on a change in pull request #18667:
URL: https://github.com/apache/airflow/pull/18667#discussion_r720793471



##########
File path: tests/www/test_security.py
##########
@@ -99,14 +99,33 @@ def setUp(self):
         log.debug("Complete setup!")
 
     @classmethod
-    def delete_roles(cls):
+    def tearDownClass(cls):
+        cls.delete_test_roles()
+        cls.delete_test_users()
+
+    @classmethod
+    def delete_test_users(cls):
+        method_users = [attr[5:] for attr in cls.__dict__ if attr[:4] == 
'test']
+        adhoc_users = [
+            'ElUser',
+            'Monsieur User',
+            'dag_access_user',
+            'LaUser',
+            'dag_permission_user'
+        ]

Review comment:
       Adhoc users list is static and taken from this suite's test cases. They 
are created and never deleted. This func has the same logic (with static list) 
as existing delete_roles func. So I thought it makes them inline anyway.
   Method users are there as there are tests that uses func name as a username, 
so instead of listing them all in here func tries to find those as well for 
deletion.
   Ideally it would be better to have something like create_user_scope function 
like I have added in the other PR but that suite uses pytest api.




-- 
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]


Reply via email to