Skip to content

Commit

Permalink
Add tests for Security Views (#8180)
Browse files Browse the repository at this point in the history
This would avoid cases like the one that was solved in apache/airflow#8165

GitOrigin-RevId: 17fbd7a9d8930a5fd252b3db8f6574d4375b8a52
  • Loading branch information
kaxil authored and Cloud Composer Team committed Mar 9, 2022
1 parent 41715cf commit 37c08d8
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/www/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,30 @@ def test_home(self):
resp = self.client.get('home', follow_redirects=True)
self.check_content_in_response('DAGs', resp)

def test_users_list(self):
resp = self.client.get('users/list', follow_redirects=True)
self.check_content_in_response('List Users', resp)

def test_roles_list(self):
resp = self.client.get('roles/list', follow_redirects=True)
self.check_content_in_response('List Roles', resp)

def test_userstatschart_view(self):
resp = self.client.get('userstatschartview/chart/', follow_redirects=True)
self.check_content_in_response('User Statistics', resp)

def test_permissions_list(self):
resp = self.client.get('permissions/list/', follow_redirects=True)
self.check_content_in_response('List Base Permissions', resp)

def test_viewmenus_list(self):
resp = self.client.get('viewmenus/list/', follow_redirects=True)
self.check_content_in_response('List View Menus', resp)

def test_permissionsviews_list(self):
resp = self.client.get('permissionviews/list/', follow_redirects=True)
self.check_content_in_response('List Permissions on Views/Menus', resp)

def test_home_filter_tags(self):
from airflow.www.views import FILTER_TAGS_COOKIE
with self.client:
Expand Down

0 comments on commit 37c08d8

Please sign in to comment.