@pytest.mark.django_db
def test_valid_permissions_for_all_modules():
 for module in get_modules():
  url_permissions = set(get_permissions_from_urls(module.get_urls()))
  module_permissions = set(module.get_required_permissions())
  for permission in (url_permissions | module_permissions):
   if (module.__class__ in migrated_permissions):
    assert (permission in migrated_permissions[module.__class__])
   else:
    assert get_permission_object_from_string(permission)

@ pytest . mark . django_db def test_valid_permissions_for_all_modules ( ) : for module in get_modules ( ) : url_permissions = set ( get_permissions_from_urls ( module . get_urls ( ) ) ) module_permissions = set ( module . get_required_permissions ( ) ) for permission in ( url_permissions | module_permissions ) : if ( module . __class__ in migrated_permissions ) : assert ( permission in migrated_permissions [ module . __class__ ] ) else : assert get_permission_object_from_string ( permission )
if a module requires permissions .