from importlib import import_module
from unittest import TestCase as UnitTestCase

from django.contrib.auth.models import Group
from django.core.management import BaseCommand
from django.conf import settings
from django.test import TestCase
from django.views.generic import TemplateView
try:
    from unittest.mock import Mock, patch, MagicMock
except:
    from mock import Mock, patch

from django_roles_access.decorator import access_by_role
from django_roles_access.mixin import RolesMixin
from django_roles_access.models import ViewAccess
from tests import views
from django_roles_access.utils import (walk_site_url, get_views_by_app,
                                       view_access_analyzer,
                                       get_view_analyze_report,
                                       check_django_roles_is_used,
                                       analyze_by_role, APP_NAME_FOR_NONE,
                                       NOT_SECURED_DEFAULT, SECURED_DEFAULT,
                                       PUBLIC_DEFAULT, NONE_TYPE_DEFAULT,
                                       DISABLED_DEFAULT, OutputReport)


class MockRegex:
    def __init__(self):
        self.pattern = '^fake-regex-pattern/$'


class MockRegexResolver:
    def __init__(self):
        self.pattern = '^fake-resolver/'


class MockRegexResolverNested:
    def __init__(self):
        self.pattern = '^fake-nested-resolver/'


class MockPattern:
    def __init__(self):
        self.regex = MockRegex()
        self.callback = 'fake-callback'
        self.name = 'fake-view-name'


class MockResolver:
    def __init__(self):
        self.url_patterns = [MockPattern()]
        self.regex = MockRegexResolver()
        self.app_name = 'fake-app-name'
        self.namespace = 'fake-namespace'


class MockResolverNested:
    def __init__(self):
        self.url_patterns = [MockResolver()]
        self.regex = MockRegexResolverNested()
        self.app_name = 'fake-app-name'
        self.namespace = 'nested-namespace'


class MockPatternDjango2:
    def __init__(self):
        self.pattern = '^fake-pattern/'
        self.callback = 'fake-callback'
        self.name = 'fake-view-name'


class MockPatternDjango2None:
    def __init__(self):
        self.pattern = '^fake-pattern/'
        self.callback = 'fake-callback'
        self.name = 'fake-view-none'


class MockResolverDjango2:
    def __init__(self):
        self.pattern = '^fake-resolver/'
        self.url_patterns = [MockPatternDjango2()]
        self.app_name = 'fake-app-name'
        self.namespace = 'fake-namespace'


class MockResolverDjango2None:
    def __init__(self):
        self.pattern = '^fake-resolver/'
        self.url_patterns = [MockPatternDjango2None()]
        self.app_name = None
        self.namespace = None


class MockResolverDjango2None2:
    def __init__(self):
        self.pattern = '^fake-resolver/'
        self.url_patterns = [MockResolverDjango2None()]
        self.app_name = 'fake-app-name'
        self.namespace = 'fake-namespace'


class MockResolverDjangoNested:
    def __init__(self):
        self.pattern = '^fake-nested-resolver/'
        self.url_patterns = [MockResolverDjango2()]
        self.app_name = 'fake-app-name'
        self.namespace = 'nested-namespace'


class UnitTestWalkSiteURL(UnitTestCase):

    def setUp(self):
        self.pattern_1 = MockPattern()
        self.data = [self.pattern_1]

    def test_second_param_is_optional_return_a_list(self):
        result = walk_site_url(self.data)
        self.assertIsInstance(result, list)

    def test_first_param_list_of_pattern_and_view(self):
        result = walk_site_url(self.data)
        self.assertEqual(result, [('fake-regex-pattern/', 'fake-callback',
                                   'fake-view-name', None)])

    def test_first_param_list_of_patterns_and_views(self):
        pattern_2 = MockPattern()
        pattern_2.regex.pattern = 'fake-regex-pattern-2/'
        pattern_2.callback = 'fake-view-2'
        result = walk_site_url([self.pattern_1, pattern_2])
        self.assertEqual(result, [('fake-regex-pattern/', 'fake-callback',
                                   'fake-view-name', None),
                                  ('fake-regex-pattern-2/', 'fake-view-2',
                                   'fake-view-name', None)])

    def test_param_list_with_pattern_and_resolver_django_1(self):
        expected_result = [
            ('fake-regex-pattern/', 'fake-callback', 'fake-view-name', None),
            ('fake-resolver/fake-regex-pattern/',
             'fake-callback', 'fake-namespace:fake-view-name', 'fake-app-name'
             )]
        resolver = MockResolver()
        result = walk_site_url([self.pattern_1, resolver])
        self.assertEqual(result, expected_result)

    def test_param_list_with_pattern_and_nested_resolver_django_1(self):
        expected_result = [
            ('fake-regex-pattern/', 'fake-callback', 'fake-view-name', None),
            ('fake-nested-resolver/fake-resolver/fake-regex-pattern/',
             'fake-callback', 'nested-namespace:fake-namespace:fake-view-name',
             'fake-app-name'
             )
        ]
        resolver = MockResolverNested()
        result = walk_site_url([self.pattern_1, resolver])
        self.assertEqual(result, expected_result)

    def test_param_list_with_pattern_and_resolver_django_2(self):
        expected_result = [
            ('fake-pattern/', 'fake-callback', 'fake-view-name', None),
            ('fake-resolver/fake-pattern/',
             'fake-callback', 'fake-namespace:fake-view-name', 'fake-app-name'
             )
        ]
        resolver = MockResolverDjango2()
        result = walk_site_url([MockPatternDjango2(), resolver])
        self.assertEqual(result, expected_result)

    def test_param_list_with_pattern_and_nested_resolver_django_2(self):
        expected_result = [
            ('fake-pattern/', 'fake-callback', 'fake-view-name', None),
            ('fake-nested-resolver/fake-resolver/fake-pattern/',
             'fake-callback', 'nested-namespace:fake-namespace:fake-view-name',
             'fake-app-name'
             )
        ]
        result = walk_site_url([MockPatternDjango2(),
                                MockResolverDjangoNested()])
        self.assertEqual(result, expected_result)

    def test_param_list_with_resolver_get_app_name_and_view_name_django_1(self):
        expected_result = [
            ('fake-resolver/fake-regex-pattern/',
             'fake-callback', 'fake-namespace:fake-view-name', 'fake-app-name'
             ),
            ('fake-nested-resolver/fake-resolver/fake-regex-pattern/',
             'fake-callback', 'nested-namespace:fake-namespace:fake-view-name',
             'fake-app-name'
             )
        ]
        result = walk_site_url([MockResolver(), MockResolverNested()])
        self.assertEqual(result, expected_result)

    def test_param_list_with_resolver_get_app_name_and_view_name_django_2(self):
        expected_result = [
            ('fake-resolver/fake-pattern/',
             'fake-callback', 'fake-namespace:fake-view-name', 'fake-app-name'
             ),
            ('fake-nested-resolver/fake-resolver/fake-pattern/',
             'fake-callback', 'nested-namespace:fake-namespace:fake-view-name',
             'fake-app-name'
             )
        ]
        resolver = MockResolverDjango2()
        nested_resolver = MockResolverDjangoNested()
        result = walk_site_url([resolver, nested_resolver])
        self.assertEqual(result, expected_result)

    def test_when_url_namespace_is_None(self):
        expected_result = [
            ('fake-resolver/fake-resolver/fake-pattern/',
             'fake-callback', 'fake-view-none', None
             )
        ]
        resolver = MockResolverDjango2None2()
        result = walk_site_url([resolver])
        self.assertEqual(result, expected_result)

    # def test_when_view_name_is_None(self):
    #     expected_result = [
    #         ('fake-resolver/fake-pattern/',
    #          'fake-callback', 'fake-view-name', None
    #          )
    #     ]
    #     resolver = MockResolverDjango2None2()
    #     result = walk_site_url([resolver])
    #     print(result)
    #     self.assertEqual(result, expected_result)


class IntegratedTestWalkSiteURL(TestCase):

    def setUp(self):
        self.url = import_module(settings.ROOT_URLCONF).urlpatterns

    def test_found_direct_access_view(self):
        expected_result = ('direct_access_view/',
                           views.protected_view_by_role,
                           'direct_access_view', None)
        result = walk_site_url(self.url)
        self.assertIn(expected_result, result)

    def test_found_included_view_without_namespace(self):
        expected_result = ('role-included[135]/view_by_role/',
                           views.protected_view_by_role,
                           'django_roles_access:view_protected_by_role',
                           'django_roles_access')
        result = walk_site_url(self.url)
        self.assertIn(expected_result, result)

    def test_found_included_view_with_namespace(self):
        expected_result = ('role-included2/view_by_role/',
                           views.protected_view_by_role,
                           'app-ns2:view_protected_by_role',
                           'django_roles_access')
        result = walk_site_url(self.url)
        self.assertIn(expected_result, result)

    def test_found_nested_access_view(self):
        expected_result = ('nest1/nest2/view_by_role/',
                           views.protected_view_by_role,
                           'nest1_namespace:nest2_namespace:view_'
                           'protected_by_role',
                           'roles-app-name')
        result = walk_site_url(self.url)
        self.assertIn(expected_result, result)


class UnitTestGetViewsByApp(UnitTestCase):
    """
    get_views_by_app receive the result of walk_site_url and is required to
    return a dictionary with keys been installed applications.
    """
    def setUp(self):
        self.data = [('a', 'b', 'c', 'fake-app-1')]

    @patch('django_roles_access.utils.settings')
    def test_returns_a_dictionary(
            self, mock_settings
    ):
        mock_settings.INSTALLED_APPS = ['fake-app-1', 'fake-app-2']
        result = get_views_by_app(self.data)
        self.assertIsInstance(result, dict)

    @patch('django_roles_access.utils.settings')
    def test_returns_a_dictionary_with_all_installed_apps(
            self, mock_settings
    ):
        mock_settings.INSTALLED_APPS = ['fake-app-1', 'fake-app-2']
        result = get_views_by_app(self.data)
        assert 'fake-app-1' in result
        assert 'fake-app-2' in result

    @patch('django_roles_access.utils.settings')
    def test_values_of_returned_dictionary_keys_are_lists(
            self, mock_settings
    ):
        mock_settings.INSTALLED_APPS = ['fake-app-1', 'fake-app-2']
        result = get_views_by_app(self.data)
        self.assertIsInstance(result['fake-app-1'], list)
        self.assertIsInstance(result['fake-app-2'], list)

    @patch('django_roles_access.utils.settings')
    def test_receive_list_of_tuples_with_4_element(
            self, mock_settings
    ):
        mock_settings.INSTALLED_APPS = ['fake-app-1']
        result = get_views_by_app(self.data)
        assert 'fake-app-1' in result

    @patch('django_roles_access.utils.settings')
    def test_raise_type_error_if_receive_list_of_tuples_with_3_element(
            self, mock_settings
    ):
        mock_settings.INSTALLED_APPS = ['fake-app-1']
        data = [('a', 'b', 'c')]
        with self.assertRaises(TypeError):
            get_views_by_app(data)

    @patch('django_roles_access.utils.settings')
    def test_raise_type_error_if_receive_list_of_tuples_with_5_element(
            self, mock_settings
    ):
        mock_settings.INSTALLED_APPS = ['fake-app-1']
        data = [('a', 'b', 'c', 'd', 'e')]
        with self.assertRaises(TypeError):
            get_views_by_app(data)

    @patch('django_roles_access.utils.settings')
    def test_received_data_is_ordered_and_returned_by_application(
            self, mock_settings
    ):
        mock_settings.INSTALLED_APPS = ['fake-app-1', 'fake-app-2', None]
        data = [('a', 'b', 'c', 'fake-app-1'), ('1', '2', '3', 'fake-app-2'),
                ('a1', 'b2', 'c3', None)]
        expected_result = [('a', 'b', 'c')]
        result = get_views_by_app(data)
        self.assertEqual(expected_result, result['fake-app-1'])

    @patch('django_roles_access.utils.settings')
    def test_can_work_with_no_declared_application_name(
            self, mock_settings
    ):
        mock_settings.INSTALLED_APPS = ['fake-app-1', 'fake-app-2', None]
        data = [('a', 'b', 'c', 'fake-app-1'), ('1', '2', '3', 'fake-app-2'),
                ('a1', 'b2', 'c3', None)]
        expected_result = [('a1', 'b2', 'c3')]
        result = get_views_by_app(data)
        self.assertEqual(expected_result, result[APP_NAME_FOR_NONE])

    @patch('django_roles_access.utils.settings')
    def test_if_application_is_not_in_installed_apps_will_not_be_in_dict(
            self, mock_settings
    ):
        mock_settings.INSTALLED_APPS = ['fake-app-1', 'fake-app-2', None]
        result = get_views_by_app(self.data)
        assert 'fake-app-3' not in result


class IntegratedTestGetViewsByApp(TestCase):

    def setUp(self):
        self.url = import_module(settings.ROOT_URLCONF).urlpatterns
    
    def test_not_declared_app_are_recognized_as_undefined_app(self):
        expected_result = ('direct_access_view/',
                           views.protected_view_by_role,
                           'direct_access_view')
        result = get_views_by_app(walk_site_url(self.url))
        self.assertIn(expected_result, result[APP_NAME_FOR_NONE])

    def test_views_without_namespace_are_added_with_app_name_in_view_name(self):
        expected_result = ('role-included[135]/view_by_role/',
                           views.protected_view_by_role,
                           'django_roles_access:view_protected_by_role')
        result = get_views_by_app(walk_site_url(self.url))
        self.assertIn(expected_result, result['django_roles_access'])

    def test_view_with_namespace_are_added_with_correct_app_name(self):
        expected_result = ('role-included2/view_by_role/',
                           views.protected_view_by_role,
                           'app-ns2:view_protected_by_role')
        result = get_views_by_app(walk_site_url(self.url))
        self.assertIn(expected_result, result['django_roles_access'])

    def test_nested_namespace_are_added_with_correct_app_name(self):
        expected_result = ('nest1/nest2/view_by_role/',
                           views.protected_view_by_role,
                           'nest1_namespace:nest2_namespace:view_'
                           'protected_by_role')
        result = get_views_by_app(walk_site_url(self.url))
        self.assertIn(expected_result, result['roles-app-name'])


class TestGetViewAnalyzeReport(UnitTestCase):

    def test_report_for_no_application_type(self):
        expected = u'\t' + NONE_TYPE_DEFAULT
        result = get_view_analyze_report(None)
        self.assertEqual(result, expected)

    def test_report_for_application_type_NOT_SECURED(self):
        expected = u'\t' + NOT_SECURED_DEFAULT
        result = get_view_analyze_report('NOT_SECURED')
        self.assertEqual(result, expected)
        self.assertEqual(result, expected)

    def test_report_for_application_type_DISABLED(self):
        expected = u'\t' + DISABLED_DEFAULT
        result = get_view_analyze_report('DISABLED')
        self.assertEqual(result, expected)

    def test_report_for_application_type_SECURED(self):
        expected = u'\t' + SECURED_DEFAULT
        result = get_view_analyze_report('SECURED')
        self.assertEqual(result, expected)

    def test_report_for_application_type_PUBLIC(self):
        expected = u'\t' + PUBLIC_DEFAULT
        result = get_view_analyze_report('PUBLIC')
        self.assertEqual(result, expected)


class TestCheckDjangoRolesIsUsed(UnitTestCase):

    def test_detect_view_is_decorated(self):
        @access_by_role
        def function():
            pass
        self.assertTrue(check_django_roles_is_used(function))

    def test_detect_view_is_not_decorated(self):
        def function():
            pass
        self.assertFalse(check_django_roles_is_used(function()))

    def test_detect_view_use_mixin(self):
        class Aview(RolesMixin, TemplateView):
            template_name = 'dummyTemplate.html'
        self.assertTrue(check_django_roles_is_used(Aview))

    def test_detect_view_not_use_mixin(self):
        class Aview(TemplateView):
            template_name = 'dummyTemplate.html'
        self.assertFalse(check_django_roles_is_used(Aview))


@patch('django_roles_access.utils.ViewAccess')
class UnitTestAnalyzeByRoleAccess(UnitTestCase):

    def test_detect_access_is_by_role(
            self, mock_view_access
    ):
        expected = u'ERROR: No roles configured to access de view.'
        mock_view_access.type = 'br'
        mock_view_access.roles.count.return_value = 0
        result = analyze_by_role(mock_view_access)
        self.assertEqual(result, expected)

    def test_detect_access_is_not_by_role(
            self, mock_view_access
    ):
        expected = u''
        mock_view_access.type = 'pu'
        result = analyze_by_role(mock_view_access)
        self.assertEqual(result, expected)

    def test_detect_access_is_not_by_role_with_roles(
            self, mock_view_access
    ):
        expected = u'Roles with access: role-1, role-2'
        mock_view_access.type = 'br'
        role_1 = Mock()
        role_1.name = u'role-1'
        role_2 = Mock()
        role_2.name = u'role-2'
        mock_view_access.roles.all.return_value = [role_1, role_2]
        result = analyze_by_role(mock_view_access)
        self.assertEqual(result, expected)

    def test_detect_access_is_not_by_role_without_roles(
            self, mock_view_access
    ):
        expected = u'ERROR: No roles configured to access de view.'
        mock_view_access.type = 'br'
        mock_view_access.roles.count.return_value = 0
        result = analyze_by_role(mock_view_access)
        self.assertEqual(result, expected)


class IntegratedTestAnalyzeByRoleAccess(TestCase):

    def test_detect_access_is_by_role(self):
        expected = u'ERROR: No roles configured to access de view.'
        view_access = ViewAccess.objects.create(view='any-name', type='br')
        result = analyze_by_role(view_access)
        self.assertEqual(result, expected)

    def test_detect_access_is_not_by_role(self):
        expected = u''
        view_access = ViewAccess.objects.create(view='any-name', type='pu')
        result = analyze_by_role(view_access)
        self.assertEqual(result, expected)

    def test_detect_access_is_by_role_with_roles(self):
        expected = u'Roles with access: role-1, role-2'
        view_access = ViewAccess.objects.create(view='any-name', type='br')
        role_1, created = Group.objects.get_or_create(name='role-1')
        role_2, created = Group.objects.get_or_create(name='role-2')
        view_access.roles.add(role_1)
        view_access.roles.add(role_2)
        view_access.save()
        result = analyze_by_role(view_access)
        self.assertEqual(result, expected)

    def test_detect_access_is_not_by_role_without_roles(self):
        expected = u'ERROR: No roles configured to access de view.'
        view_access = ViewAccess.objects.create(view='any-name', type='br')
        result = analyze_by_role(view_access)
        self.assertEqual(result, expected)


@patch('django_roles_access.utils.ViewAccess.objects')
class UnitTestViewAnalyzer(UnitTestCase):

    def test_view_analyzer_return_a_report(
            self, mock_objects
    ):
        view_access = Mock()
        view_access.type = 'pu'
        mock_objects.filter.return_value = mock_objects
        mock_objects.first.return_value = view_access
        result = view_access_analyzer('fake-app-type', 'fake-callback',
                                      'fake-view-name', 'fake-site-active')
        try:
            self.assertIsInstance(result, unicode)
        except:
            self.assertIsInstance(result, str)

    def test_view_analyzer_search_view_access_for_the_view(
            self, mock_objects
    ):
        view_access = Mock()
        view_access.type = 'pu'
        mock_objects.filter.return_value = mock_objects
        mock_objects.first.return_value = view_access
        view_access_analyzer('fake-app-type', 'fake-callback',
                             'fake-view-name', 'fake-site-active')
        assert mock_objects.first.called

    def test_view_analyzer_search_view_access_for_the_view_once(
            self, mock_objects
    ):
        view_access = Mock()
        view_access.type = 'pu'
        mock_objects.filter.return_value = mock_objects
        mock_objects.first.return_value = view_access
        view_access_analyzer('fake-app-type', 'fake-callback',
                             'fake-view-name', 'fake-site-active')
        self.assertEqual(mock_objects.filter.call_count, 1)

    def test_view_analyzer_search_view_access_with_view_name(
            self, mock_objects
    ):
        view_access = Mock()
        view_access.type = 'pu'
        mock_objects.filter.return_value = mock_objects
        mock_objects.first.return_value = view_access
        view_access_analyzer('fake-app-type', 'fake-callback',
                             'fake-view-name', 'fake-site-active')
        mock_objects.filter.assert_called_once_with(view='fake-view-name')

    def test_view_access_type_when_site_active_and_exists_view_access(
            self, mock_objects
    ):
        expected = u'View access is of type Public.'
        view_access = Mock()
        view_access.type = 'pu'
        mock_objects.filter.return_value = mock_objects
        mock_objects.first.return_value = view_access
        result = view_access_analyzer('fake-app-type', 'fake-callback',
                                      'fake-view-name', True)
        self.assertEqual(result, expected)

    @patch('django_roles_access.utils.analyze_by_role')
    def test_view_access_type_by_role_call_analyze_by_role(
            self, mock_analyze_by_role, mock_objects
    ):
        view_access = Mock()
        view_access.type = 'br'
        mock_objects.filter.return_value = mock_objects
        mock_objects.first.return_value = view_access
        view_access_analyzer('fake-app-type', 'fake-callback',
                             'fake-view-name', True)
        assert mock_analyze_by_role.called

    @patch('django_roles_access.utils.analyze_by_role')
    def test_view_access_type_by_role_call_analyze_by_role_once(
            self, mock_analyze_by_role, mock_objects
    ):
        view_access = Mock()
        view_access.type = 'br'
        mock_objects.filter.return_value = mock_objects
        mock_objects.first.return_value = view_access
        view_access_analyzer('fake-app-type', 'fake-callback',
                             'fake-view-name', True)
        self.assertEqual(mock_analyze_by_role.call_count, 1)

    @patch('django_roles_access.utils.analyze_by_role')
    def test_view_access_type_by_role_call_analyze_by_role_with_view_access(
            self, mock_analyze_by_role, mock_objects
    ):
        view_access = Mock()
        view_access.type = 'br'
        mock_objects.filter.return_value = mock_objects
        mock_objects.first.return_value = view_access
        view_access_analyzer('fake-app-type', 'fake-callback',
                             'fake-view-name', True)
        mock_analyze_by_role.assert_called_once_with(view_access)

    def test_no_view_access_object_for_the_view_and_site_active_no_app_type(
            self, mock_objects
    ):
        expected = u'\t' + NONE_TYPE_DEFAULT
        mock_objects.filter.return_value = mock_objects
        mock_objects.first.return_value = None
        result = view_access_analyzer(None, 'fake-callback',
                                      'fake-view-name', True)
        self.assertEqual(result, expected)

    def test_no_view_access_object_and_site_active_app_type_NOT_SECURED(
            self, mock_objects
    ):
        expected = u'\t' + NOT_SECURED_DEFAULT
        mock_objects.filter.return_value = mock_objects
        mock_objects.first.return_value = None
        result = view_access_analyzer('NOT_SECURED', 'fake-callback',
                                      'fake-view-name', True)
        self.assertEqual(result, expected)

    def test_no_view_access_object_and_site_active_app_type_DISABLED(
            self, mock_objects
    ):
        expected = u'\t' + DISABLED_DEFAULT
        mock_objects.filter.return_value = mock_objects
        mock_objects.first.return_value = None
        result = view_access_analyzer('DISABLED', 'fake-callback',
                                      'fake-view-name', True)
        self.assertEqual(result, expected)

    def test_no_view_access_object_and_site_active_app_type_SECURED(
            self, mock_objects
    ):
        expected = u'\t' + SECURED_DEFAULT
        mock_objects.filter.return_value = mock_objects
        mock_objects.first.return_value = None
        result = view_access_analyzer('SECURED', 'fake-callback',
                                      'fake-view-name', True)
        self.assertEqual(result, expected)

    def test_no_view_access_object_and_site_active_app_type_PUBLIC(
            self, mock_objects
    ):
        expected = u'\t' + PUBLIC_DEFAULT
        mock_objects.filter.return_value = mock_objects
        mock_objects.first.return_value = None
        result = view_access_analyzer('PUBLIC', 'fake-callback',
                                      'fake-view-name', True)
        self.assertEqual(result, expected)

    def test_middleware_not_used_view_access_object_exist_and_dr_tools_used(
            self, mock_objects
    ):
        expected = u'View access is of type Public.'

        @access_by_role
        def function():
            pass
        view_access = Mock()
        view_access.type = 'pu'
        mock_objects.filter.return_value = mock_objects
        mock_objects.first.return_value = view_access
        result = view_access_analyzer('fake-app-type', function,
                                      'fake-view-name', False)
        self.assertEqual(result, expected)

    def test_middleware_not_used_view_access_object_exist_and_dr_tools_not_used(
            self, mock_objects
    ):
        expected = u'ERROR: View access object exist for the view, but no '
        expected += u'Django role access tool is used: neither decorator, '
        expected += u'mixin, or middleware.'

        def function():
            pass

        view_access = Mock()
        view_access.type = 'pu'
        mock_objects.filter.return_value = mock_objects
        mock_objects.first.return_value = view_access
        result = view_access_analyzer('fake-app-type', function,
                                      'fake-view-name', False)
        self.assertEqual(result, expected)

    def test_middleware_not_used_dr_tools_are_used_no_view_access_object(
            self, mock_objects
    ):
        expected = u'\t' + PUBLIC_DEFAULT

        @access_by_role
        def function():
            pass
        mock_objects.filter.return_value = mock_objects
        mock_objects.first.return_value = None
        result = view_access_analyzer('PUBLIC', function,
                                      'fake-view-name', False)
        self.assertEqual(result, expected)

    def test_no_django_roles_tools_used_no_application_type(
            self, mock_objects
    ):
        expected = u'No Django roles access tool used. Access to view depends '
        expected += u'on its implementation.'

        def function():
            pass
        mock_objects.filter.return_value = mock_objects
        mock_objects.first.return_value = None
        result = view_access_analyzer(None, function,
                                      'fake-view-name', False)
        self.assertEqual(result, expected)

    def test_no_django_roles_tools_used_application_type(
            self, mock_objects
    ):
        expected = u'No Django roles access tool used. Access to view depends '
        expected += u'on its implementation.'

        def function():
            pass
        mock_objects.filter.return_value = mock_objects
        mock_objects.first.return_value = None
        result = view_access_analyzer('Authorized', function,
                                      'fake-view-name', False)
        self.assertEqual(result, expected)


class IntegratedTestViewAnalyzezr(TestCase):

    def test_with_middleware_SECURED_without_view_access_object(self):
        expected = u'\t' + SECURED_DEFAULT
        result = view_access_analyzer(
            'SECURED', views.MiddlewareView.as_view,
            'django_roles_access:middleware_view_class',
            True)
        self.assertEqual(expected, result)

    def test_with_middleware_NOT_SECURED_with_view_access_object(self):
        ViewAccess.objects.create(
            view='django_roles_access:middleware_view_class',
            type='br')
        result = view_access_analyzer(
            'NOT_SECURED', views.MiddlewareView.as_view,
            'django_roles_access:middleware_view_class',
            True)
        self.assertEqual(result, u'\t' + NOT_SECURED_DEFAULT)

    def test_with_middleware_DISABLED_with_view_access_object(self):
        ViewAccess.objects.create(
            view='django_roles_access:middleware_view_class',
            type='pu')
        result = view_access_analyzer(
            'DISABLED', views.MiddlewareView.as_view,
            'django_roles_access:middleware_view_class',
            True)
        self.assertEqual(result, u'\t' + DISABLED_DEFAULT)

    def test_with_middleware_with_view_access_object(self):
        expected = u'View access is of type By role.'
        expected += u'ERROR: No roles configured to access de view.'
        ViewAccess.objects.create(
            view='django_roles_access:middleware_view_class',
            type='br')
        result = view_access_analyzer(
            'SECURED', views.MiddlewareView.as_view,
            'django_roles_access:middleware_view_class',
            True)
        self.assertEqual(result, expected)

    def test_with_middleware_with_view_access_object_with_roles(self):
        expected = u'View access is of type By role.'
        expected += u'Roles with access: test1, test2'
        g1, created = Group.objects.get_or_create(name='test1')
        g2, created = Group.objects.get_or_create(name='test2')
        view_access = ViewAccess.objects.create(
            view='django_roles_access:middleware_view_class',
            type='br')
        view_access.roles.add(g1)
        view_access.roles.add(g2)
        view_access.save()
        result = view_access_analyzer(
            'SECURED', views.MiddlewareView.as_view,
            'django_roles_access:middleware_view_class',
            True)
        self.assertEqual(result, expected)

    def test_with_middleware_with_view_access_object_authorized(self):
        expected = u'View access is of type Authorized.'
        ViewAccess.objects.create(
            view='django_roles_access:middleware_view_class',
            type='au')
        result = view_access_analyzer(
            'SECURED', views.MiddlewareView.as_view,
            'django_roles_access:middleware_view_class',
            True)
        self.assertEqual(result, expected)

    def test_with_middleware_with_view_access_object_public(self):
        expected = u'View access is of type Public.'
        ViewAccess.objects.create(
            view='django_roles_access:middleware_view_class',
            type='pu')
        result = view_access_analyzer(
            'SECURED', views.MiddlewareView.as_view,
            'django_roles_access:middleware_view_class',
            True)
        self.assertEqual(result, expected)

    def test_without_middleware_with_view_access_object(self):
        expected = u'View access is of type By role.'
        expected += u'ERROR: No roles configured to access de view.'
        ViewAccess.objects.create(
            view='django_roles_access:view_protected_by_role',
            type='br')
        result = view_access_analyzer(
            'SECURED', views.protected_view_by_role,
            'django_roles_access:view_protected_by_role',
            False)
        self.assertEqual(result, expected)

    def test_without_middleware_with_view_access_object_with_roles(self):
        expected = u'View access is of type By role.'
        expected += u'Roles with access: test1, test2'
        g1, created = Group.objects.get_or_create(name='test1')
        g2, created = Group.objects.get_or_create(name='test2')
        view_access = ViewAccess.objects.create(
            view='django_roles_access:view_protected_by_role',
            type='br')
        view_access.roles.add(g1)
        view_access.roles.add(g2)
        view_access.save()
        result = view_access_analyzer(
            'SECURED', views.protected_view_by_role,
            'django_roles_access:view_protected_by_role',
            False)
        self.assertEqual(result, expected)

    def test_without_middleware_with_view_access_object_authorized(self):
        expected = u'View access is of type Authorized.'
        ViewAccess.objects.create(
            view='django_roles_access:view_protected_by_role',
            type='au')
        result = view_access_analyzer(
            'SECURED', views.protected_view_by_role,
            'django_roles_access:view_protected_by_role',
            False)
        self.assertEqual(result, expected)

    def test_without_middleware_with_view_access_object_public(self):
        expected = u'View access is of type Public.'
        ViewAccess.objects.create(
            view='django_roles_access:view_protected_by_role',
            type='pu')
        result = view_access_analyzer(
            'SECURED', views.protected_view_by_role,
            'django_roles_access:view_protected_by_role',
            False)
        self.assertEqual(result, expected)

    def test_without_middleware_without_view_access_object_and_view_protected(
            self
    ):
        expected = u'\t' + SECURED_DEFAULT
        result = view_access_analyzer(
            'SECURED', views.protected_view_by_role,
            'django_roles_access:view_protected_by_role',
            False)
        self.assertEqual(result, expected)

    def test_without_middleware_no_view_access_object_and_view_protected_without_app(
            self
    ):
        expected = u'\t' + NONE_TYPE_DEFAULT

        result = view_access_analyzer(
            None, views.protected_view_by_role,
            'django_roles_access:view_protected_by_role',
            False)
        self.assertEqual(result, expected)

    def test_without_middleware_with_view_access_object_and_view_not_protected(
            self
    ):
        expected = u'ERROR: View access object exist for the view, '
        expected += 'but no Django role access tool is used: neither '
        expected += 'decorator, mixin, or middleware.'
        ViewAccess.objects.create(
            view='django_roles_access:middleware_view_func',
            type='pu')
        result = view_access_analyzer(
            None, views.middleware_view,
            'django_roles_access:middleware_view_func',
            False)
        self.assertEqual(result, expected)


class UnitTestOutputReport(UnitTestCase):

    def setUp(self):
        self.patch_mock_stdout = patch.object(BaseCommand(), 'style')
        self.patch_mock_style = patch.object(BaseCommand(), 'stdout')
        self.mock_stdout = self.patch_mock_stdout.start()
        self.mock_style = self.patch_mock_style.start()
        self._output = OutputReport(self.mock_stdout, self.mock_style)

    def tearDown(self):
        self.patch_mock_stdout.stop()
        self.patch_mock_style.stop()

    def test_initial_with_parameter(self):
        assert self._output.stdout == self.mock_stdout
        assert self._output.style == self.mock_style

    def test_internal_attributes_are_initialize(self):
        assert hasattr(self._output, '_row') and self._output._row == u''
        assert hasattr(self._output, '_format') and self._output._format == \
               'console'

    def test_initial_without_parameter(self):
        with self.assertRaises(TypeError) as e:
            OutputReport()

    def test_default_output_format_is_correct_type(self):
        assert self._output._format == 'console'

    def test_set_format(self):
        self._output.set_format('csv')
        assert self._output._format == 'csv'

    def test_add_to_row(self):
        self._output.add_to_row('text')
        self._output.add_to_row('other')
        self.assertIn('text', self._output._row)
        self.assertIn('other', self._output._row)

    def test_write_method_write_to_stdout(self):
        self._output.write(u'some text')
        assert self.mock_stdout.write.called

    def test_write_method_use_stdout_write_once(self):
        self._output.write(u'some text')
        self.assertEqual(self.mock_stdout.write.call_count, 1)

    def test_write_method_use_SUCCESS_style_for_styling_output(self):
        self._output.write(u'some text')
        self.mock_stdout.write.assert_called_once_with(
            self.mock_style.SUCCESS())

    def test_write_method_use_SUCCESS_style_for_output(self):
        self._output.write(u'some text')
        assert self.mock_style.SUCCESS.called

    def test_write_method_use_style_with_received_argument(self):
        self._output.write(u'some text')
        self.mock_style.SUCCESS.assert_called_once_with(u'some text')

    def test_console_format_write_correct_header_to_stdout_with_SUCCESS_style(
            self
    ):
        expected = u'Start checking views access.\n'
        expected += u'Start gathering information.'
        self._output.write_header()
        self.mock_style.SUCCESS.assert_called_once_with(expected)
        self.assertEqual(self.mock_stdout.write.call_count, 1)

    @patch('django_roles_access.utils.timezone')
    def test_cvs_format_write_correct_header(
            self, mock_timezone
    ):
        mock_timezone.now.return_value = 'fake-date'
        self._output.set_format('csv')
        self._output.write_header()
        self.mock_style.SUCCESS.assert_called_once_with(u'Reported: fake-date')
        self.assertEqual(self.mock_stdout.write.call_count, 1)

    def test_console_format_write_correct_middleware_status_and_end_of_header(
            self
    ):
        expected = u'Django roles access middleware is active: False.\n'
        self._output.write_middleware_status(False)
        self.mock_style.SUCCESS.assert_called_once_with(expected)
        self.assertEqual(self.mock_stdout.write.call_count, 1)

    def test_console_format_write_correct_end_of_header(
            self
    ):
        expected = u'Finish gathering information.'
        self._output.write_end_of_head()
        self.mock_style.SUCCESS.assert_called_once_with(expected)
        self.assertEqual(self.mock_stdout.write.call_count, 1)

    def test_cvs_format_write_correct_correct_middleware_status(
            self
    ):
        expected = u'Django roles access middleware is active: False.\n'
        self._output.set_format('csv')
        self._output.write_middleware_status(False)
        self.mock_style.SUCCESS.assert_called_once_with(expected)
        self.assertEqual(self.mock_stdout.write.call_count, 1)

    def test_cvs_format_write_correct_csv_columns(
            self
    ):
        expected = u'App Name,Type,View Name,Url,Status,Status description'
        self._output.set_format('csv')
        self._output.write_end_of_head()
        self.mock_style.SUCCESS.assert_called_once_with(expected)
        self.assertEqual(self.mock_stdout.write.call_count, 1)

    def test_console_format_process_app_data_to_stdout_with_SUCCESS_style(self):
        app_name = u'fake-app-name'
        app_type = u'fake-app-type'
        view_list = ['fake-view']
        expected = u'\tAnalyzing: {}\n'.format(app_name)
        expected += u'\t\t{} is {} type.'.format(app_name, app_type)
        self._output.process_application_data(app_name, app_type, view_list)
        self.mock_style.SUCCESS.assert_called_once_with(expected)
        self.assertEqual(self.mock_stdout.write.call_count, 1)

    def test_console_format_process_app_data_without_type(self):
        app_name = u'fake-app-name'
        app_type = None
        view_list = ['fake-view']
        expected = u'\tAnalyzing: {}\n'.format(app_name)
        expected += u'\t\t{} has no type.'.format(app_name)
        self._output.process_application_data(app_name, app_type, view_list)
        self.mock_style.SUCCESS.assert_called_once_with(expected)
        self.assertEqual(self.mock_stdout.write.call_count, 1)

    def test_console_format_process_app_data_without_views(self):
        app_name = u'fake-app-name'
        app_type = u'fake-app-type'
        view_list = []
        expected = u'\tAnalyzing: {}\n'.format(app_name)
        expected += u'\t\t{} is {} type.'.format(app_name, app_type)
        expected += u'\t\t{} does not have configured views.'.format(app_name)
        self._output.process_application_data(app_name, app_type, view_list)
        self.mock_style.SUCCESS.assert_called_once_with(expected)
        self.assertEqual(self.mock_stdout.write.call_count, 1)

    def test_cvs_format_process_application_data_to_string(self):
        app_name = u'fake-app-name'
        app_type = u'fake-app-type'
        view_list = ['fake-view-list']
        expected = u'{},{},'.format(app_name, app_type, view_list)
        self._output.set_format('csv')
        self._output.process_application_data(app_name, app_type, view_list)
        self.assertEqual(expected, self._output._row)

    def test_cvs_format_process_application_data_without_type_to_string(self):
        app_name = u'fake-app-name'
        app_type = None
        view_list = ['fake-view-list']
        expected = u'fake-app-name,no type,'.format(app_name)
        self._output.set_format('csv')
        self._output.process_application_data(app_name, app_type, view_list)
        self.assertEqual(expected, self._output._row)

    def test_cvs_format_process_application_data_without_views(self):
        app_name = u'fake-app-name'
        app_type = u'fake-app-type'
        view_list = []
        expected = u'fake-app-name,fake-app-type,,,,,'.format(app_name)
        self._output.set_format('csv')
        self._output.process_application_data(app_name, app_type, view_list)
        self.assertEqual(expected, self._output._row)

    def test_console_format_process_view_data_to_stdout_with_SUCCESS_style(
            self
    ):
        view_name = u'fake-view-name'
        url = '/fake-url/'
        expected = u'\n\t\tAnalysis for view: {}'.format(view_name)
        expected += u'\n\t\tView url: {}'.format(url)
        self._output.process_view_data(view_name, url)
        self.mock_style.SUCCESS.assert_called_once_with(expected)
        self.assertEqual(self.mock_stdout.write.call_count, 1)

    def test_cvs_format_process_view_data(self):
        view_name = u'fake-view-name'
        url = '/fake-url/'
        expected = u'{},{}'.format(view_name, url)
        self._output.set_format('csv')
        self._output.process_view_data(view_name, url)
        self.assertIn(expected, self._output._row)

    # View_access_analyzer output.
    def test_console_format_write_vaa_to_stdout(self):
        self._output.write_view_access_analyzer(u'some text')
        assert self.mock_stdout.write.called

    def test_console_format_use_stdout_write_once_with_vaa(self):
        self._output.write_view_access_analyzer(u'some text')
        self.assertEqual(self.mock_stdout.write.call_count, 1)

    def test_console_format_use_SUCCESS_style_for_styling_output_of_vaa(self):
        self._output.write_view_access_analyzer(u'some text')
        self.mock_stdout.write.assert_called_once_with(
            self.mock_style.SUCCESS())

    def test_console_format_use_SUCCESS_style_for_output_of_vaa(self):
        self._output.write_view_access_analyzer(u'some text')
        assert self.mock_style.SUCCESS.called

    def test_console_format_use_style_with_vaa_result(self):
        self._output.write_view_access_analyzer(u'some text')
        self.mock_style.SUCCESS.assert_called_once_with(u'\t\tsome text')

    def test_console_format_use_ERROR_style_for_output_if_error_in_vaa(self):
        self._output.write_view_access_analyzer('ERROR: fake report')
        assert self.mock_style.ERROR.called

    def test_console_format_use_ERROR_style_with_the_error_in_vaa(self):
        self._output.write_view_access_analyzer('ERROR: fake report')
        self.mock_style.ERROR.assert_called_once_with('\t\t' +
                                                      'ERROR: fake report')

    def test_console_format_use_WARNING_style_for_output_if_warning_in_vaa(self):
        self._output.write_view_access_analyzer('WARNING: fake report')
        assert self.mock_style.WARNING.called

    def test_console_format_use_WARNING_style_with_the_warning_in_vaa(self):
        self._output.write_view_access_analyzer('WARNING: fake report')
        self.mock_style.WARNING.assert_called_once_with(
            '\t\t' + 'WARNING: fake report')

    def test_csv_format_write_view_access_analyzer_with_Normal_to_stdout(self):
        self._output.add_to_row('fake-app,fake-type,fake-view,fake-url,')
        self._output._format = 'csv'
        self._output.write_view_access_analyzer(u'fake-report')
        self.assertEqual(self.mock_stdout.write.call_count, 1)

    def test_csv_format_write_view_access_analyzer_with_Normal_to_style(self):
        self._output.add_to_row('fake-app,fake-type,fake-view,fake-url,')
        expected = u'fake-app,fake-type,fake-view,fake-url,Normal,fake-report\n'
        self._output._format = 'csv'
        self._output.write_view_access_analyzer(u'fake-report')
        self.mock_style.SUCCESS.assert_called_once_with(expected)

    def test_csv_format_write_view_access_analyzer_with_WARNING_to_stdout(self):
        self._output.add_to_row('fake-app,fake-type,fake-view,fake-url,')
        self._output._format = 'csv'
        self._output.write_view_access_analyzer('WARNING: fake-report')
        self.assertEqual(self.mock_stdout.write.call_count, 1)

    def test_csv_format_write_view_access_analyzer_with_WARNING_with_style(
            self
    ):
        self._output.add_to_row('fake-app,fake-type,fake-view,fake-url,')
        expected = u'fake-app,fake-type,fake-view,fake-url,Warning,' \
                   u'fake-report\n'
        self._output._format = 'csv'
        self._output.write_view_access_analyzer('WARNING: fake-report')
        self.mock_style.WARNING.assert_called_once_with(expected)

    def test_csv_format_write_view_access_analyzer_with_ERROR_to_stdout(self):
        self._output.add_to_row('fake-app,fake-type,fake-view,fake-url,')
        self._output._format = 'csv'
        self._output.write_view_access_analyzer('ERROR: fake-report')
        self.assertEqual(self.mock_stdout.write.call_count, 1)

    def test_csv_format_write_view_access_analyzer_with_ERROR_with_style(self):
        self._output.add_to_row('fake-app,fake-type,fake-view,fake-url,')
        expected = u'fake-app,fake-type,fake-view,fake-url,Error,fake-report\n'
        self._output._format = 'csv'
        self._output.write_view_access_analyzer('ERROR: fake-report')
        self.mock_style.ERROR.assert_called_once_with(expected)

    def test_csv_format_write_view_access_analyzer_reset_OutputFormater_row(
            self
    ):
        self._output.add_to_row('fake-app,fake-type,fake-view,fake-url,')
        self._output._format = 'csv'
        self._output.write_view_access_analyzer('fake-report')
        self.assertEqual(self._output._row, u'fake-app,fake-type,')

    def test_console_format_close_application_data_to_stdout_with_SUCCESS_style(
            self
    ):
        expected = u'\tFinish analyzing fake-app-name.'
        self._output.close_application_data('fake-app-name')
        self.mock_style.SUCCESS.assert_called_once_with(expected)
        self.assertEqual(self.mock_stdout.write.call_count, 1)

    def test_cvs_format_close_application_data_to_string(self):
        expected = u''
        self._output.set_format('csv')
        self._output.close_application_data('fake-app-name')
        self.assertEqual(self._output._row, expected)

    def test_console_format_write_footer_to_stdout_with_SUCCESS_style(self):
        expected = u'End checking view access.'
        self._output.write_footer()
        self.mock_style.SUCCESS.assert_called_once_with(expected)
        self.assertEqual(self.mock_stdout.write.call_count, 1)

    def test_cvs_format_write_footer_to_string(self):
        expected = u'\n'
        self._output.set_format('csv')
        self._output.write_footer()
        self.assertEqual(self._output._row, expected)

[((16946, 16991), 'mock.patch', 'patch', (['"""django_roles_access.utils.ViewAccess"""'], {}), "('django_roles_access.utils.ViewAccess')\n", (16951, 16991), False, 'from mock import Mock, patch\n'), ((19821, 19874), 'mock.patch', 'patch', (['"""django_roles_access.utils.ViewAccess.objects"""'], {}), "('django_roles_access.utils.ViewAccess.objects')\n", (19826, 19874), False, 'from mock import Mock, patch\n'), ((10161, 10204), 'mock.patch', 'patch', (['"""django_roles_access.utils.settings"""'], {}), "('django_roles_access.utils.settings')\n", (10166, 10204), False, 'from mock import Mock, patch\n'), ((10442, 10485), 'mock.patch', 'patch', (['"""django_roles_access.utils.settings"""'], {}), "('django_roles_access.utils.settings')\n", (10447, 10485), False, 'from mock import Mock, patch\n'), ((10779, 10822), 'mock.patch', 'patch', (['"""django_roles_access.utils.settings"""'], {}), "('django_roles_access.utils.settings')\n", (10784, 10822), False, 'from mock import Mock, patch\n'), ((11156, 11199), 'mock.patch', 'patch', (['"""django_roles_access.utils.settings"""'], {}), "('django_roles_access.utils.settings')\n", (11161, 11199), False, 'from mock import Mock, patch\n'), ((11434, 11477), 'mock.patch', 'patch', (['"""django_roles_access.utils.settings"""'], {}), "('django_roles_access.utils.settings')\n", (11439, 11477), False, 'from mock import Mock, patch\n'), ((11760, 11803), 'mock.patch', 'patch', (['"""django_roles_access.utils.settings"""'], {}), "('django_roles_access.utils.settings')\n", (11765, 11803), False, 'from mock import Mock, patch\n'), ((12096, 12139), 'mock.patch', 'patch', (['"""django_roles_access.utils.settings"""'], {}), "('django_roles_access.utils.settings')\n", (12101, 12139), False, 'from mock import Mock, patch\n'), ((12594, 12637), 'mock.patch', 'patch', (['"""django_roles_access.utils.settings"""'], {}), "('django_roles_access.utils.settings')\n", (12599, 12637), False, 'from mock import Mock, patch\n'), ((13090, 13133), 'mock.patch', 'patch', (['"""django_roles_access.utils.settings"""'], {}), "('django_roles_access.utils.settings')\n", (13095, 13133), False, 'from mock import Mock, patch\n'), ((22346, 22396), 'mock.patch', 'patch', (['"""django_roles_access.utils.analyze_by_role"""'], {}), "('django_roles_access.utils.analyze_by_role')\n", (22351, 22396), False, 'from mock import Mock, patch\n'), ((22853, 22903), 'mock.patch', 'patch', (['"""django_roles_access.utils.analyze_by_role"""'], {}), "('django_roles_access.utils.analyze_by_role')\n", (22858, 22903), False, 'from mock import Mock, patch\n'), ((23383, 23433), 'mock.patch', 'patch', (['"""django_roles_access.utils.analyze_by_role"""'], {}), "('django_roles_access.utils.analyze_by_role')\n", (23388, 23433), False, 'from mock import Mock, patch\n'), ((38468, 38511), 'mock.patch', 'patch', (['"""django_roles_access.utils.timezone"""'], {}), "('django_roles_access.utils.timezone')\n", (38473, 38511), False, 'from mock import Mock, patch\n'), ((3489, 3513), 'django_roles_access.utils.walk_site_url', 'walk_site_url', (['self.data'], {}), '(self.data)\n', (3502, 3513), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((3633, 3657), 'django_roles_access.utils.walk_site_url', 'walk_site_url', (['self.data'], {}), '(self.data)\n', (3646, 3657), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((4006, 4048), 'django_roles_access.utils.walk_site_url', 'walk_site_url', (['[self.pattern_1, pattern_2]'], {}), '([self.pattern_1, pattern_2])\n', (4019, 4048), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((4689, 4730), 'django_roles_access.utils.walk_site_url', 'walk_site_url', (['[self.pattern_1, resolver]'], {}), '([self.pattern_1, resolver])\n', (4702, 4730), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((5223, 5264), 'django_roles_access.utils.walk_site_url', 'walk_site_url', (['[self.pattern_1, resolver]'], {}), '([self.pattern_1, resolver])\n', (5236, 5264), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((7464, 7506), 'django_roles_access.utils.walk_site_url', 'walk_site_url', (['[resolver, nested_resolver]'], {}), '([resolver, nested_resolver])\n', (7477, 7506), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((7832, 7857), 'django_roles_access.utils.walk_site_url', 'walk_site_url', (['[resolver]'], {}), '([resolver])\n', (7845, 7857), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((8643, 8666), 'django_roles_access.utils.walk_site_url', 'walk_site_url', (['self.url'], {}), '(self.url)\n', (8656, 8666), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((9033, 9056), 'django_roles_access.utils.walk_site_url', 'walk_site_url', (['self.url'], {}), '(self.url)\n', (9046, 9056), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((9404, 9427), 'django_roles_access.utils.walk_site_url', 'walk_site_url', (['self.url'], {}), '(self.url)\n', (9417, 9427), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((9811, 9834), 'django_roles_access.utils.walk_site_url', 'walk_site_url', (['self.url'], {}), '(self.url)\n', (9824, 9834), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((10364, 10391), 'django_roles_access.utils.get_views_by_app', 'get_views_by_app', (['self.data'], {}), '(self.data)\n', (10380, 10391), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((10669, 10696), 'django_roles_access.utils.get_views_by_app', 'get_views_by_app', (['self.data'], {}), '(self.data)\n', (10685, 10696), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((11006, 11033), 'django_roles_access.utils.get_views_by_app', 'get_views_by_app', (['self.data'], {}), '(self.data)\n', (11022, 11033), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((11362, 11389), 'django_roles_access.utils.get_views_by_app', 'get_views_by_app', (['self.data'], {}), '(self.data)\n', (11378, 11389), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((12501, 12523), 'django_roles_access.utils.get_views_by_app', 'get_views_by_app', (['data'], {}), '(data)\n', (12517, 12523), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((12992, 13014), 'django_roles_access.utils.get_views_by_app', 'get_views_by_app', (['data'], {}), '(data)\n', (13008, 13014), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((13338, 13365), 'django_roles_access.utils.get_views_by_app', 'get_views_by_app', (['self.data'], {}), '(self.data)\n', (13354, 13365), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((15267, 15296), 'django_roles_access.utils.get_view_analyze_report', 'get_view_analyze_report', (['None'], {}), '(None)\n', (15290, 15296), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((15465, 15503), 'django_roles_access.utils.get_view_analyze_report', 'get_view_analyze_report', (['"""NOT_SECURED"""'], {}), "('NOT_SECURED')\n", (15488, 15503), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((15709, 15744), 'django_roles_access.utils.get_view_analyze_report', 'get_view_analyze_report', (['"""DISABLED"""'], {}), "('DISABLED')\n", (15732, 15744), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((15905, 15939), 'django_roles_access.utils.get_view_analyze_report', 'get_view_analyze_report', (['"""SECURED"""'], {}), "('SECURED')\n", (15928, 15939), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((16098, 16131), 'django_roles_access.utils.get_view_analyze_report', 'get_view_analyze_report', (['"""PUBLIC"""'], {}), "('PUBLIC')\n", (16121, 16131), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((17299, 17332), 'django_roles_access.utils.analyze_by_role', 'analyze_by_role', (['mock_view_access'], {}), '(mock_view_access)\n', (17314, 17332), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((17539, 17572), 'django_roles_access.utils.analyze_by_role', 'analyze_by_role', (['mock_view_access'], {}), '(mock_view_access)\n', (17554, 17572), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((17823, 17829), 'mock.Mock', 'Mock', ([], {}), '()\n', (17827, 17829), False, 'from mock import Mock, patch\n'), ((17879, 17885), 'mock.Mock', 'Mock', ([], {}), '()\n', (17883, 17885), False, 'from mock import Mock, patch\n'), ((18002, 18035), 'django_roles_access.utils.analyze_by_role', 'analyze_by_role', (['mock_view_access'], {}), '(mock_view_access)\n', (18017, 18035), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((18355, 18388), 'django_roles_access.utils.analyze_by_role', 'analyze_by_role', (['mock_view_access'], {}), '(mock_view_access)\n', (18370, 18388), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((18621, 18674), 'django_roles_access.models.ViewAccess.objects.create', 'ViewAccess.objects.create', ([], {'view': '"""any-name"""', 'type': '"""br"""'}), "(view='any-name', type='br')\n", (18646, 18674), False, 'from django_roles_access.models import ViewAccess\n'), ((18692, 18720), 'django_roles_access.utils.analyze_by_role', 'analyze_by_role', (['view_access'], {}), '(view_access)\n', (18707, 18720), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((18859, 18912), 'django_roles_access.models.ViewAccess.objects.create', 'ViewAccess.objects.create', ([], {'view': '"""any-name"""', 'type': '"""pu"""'}), "(view='any-name', type='pu')\n", (18884, 18912), False, 'from django_roles_access.models import ViewAccess\n'), ((18930, 18958), 'django_roles_access.utils.analyze_by_role', 'analyze_by_role', (['view_access'], {}), '(view_access)\n', (18945, 18958), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((19137, 19190), 'django_roles_access.models.ViewAccess.objects.create', 'ViewAccess.objects.create', ([], {'view': '"""any-name"""', 'type': '"""br"""'}), "(view='any-name', type='br')\n", (19162, 19190), False, 'from django_roles_access.models import ViewAccess\n'), ((19217, 19259), 'django.contrib.auth.models.Group.objects.get_or_create', 'Group.objects.get_or_create', ([], {'name': '"""role-1"""'}), "(name='role-1')\n", (19244, 19259), False, 'from django.contrib.auth.models import Group\n'), ((19286, 19328), 'django.contrib.auth.models.Group.objects.get_or_create', 'Group.objects.get_or_create', ([], {'name': '"""role-2"""'}), "(name='role-2')\n", (19313, 19328), False, 'from django.contrib.auth.models import Group\n'), ((19449, 19477), 'django_roles_access.utils.analyze_by_role', 'analyze_by_role', (['view_access'], {}), '(view_access)\n', (19464, 19477), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((19675, 19728), 'django_roles_access.models.ViewAccess.objects.create', 'ViewAccess.objects.create', ([], {'view': '"""any-name"""', 'type': '"""br"""'}), "(view='any-name', type='br')\n", (19700, 19728), False, 'from django_roles_access.models import ViewAccess\n'), ((19746, 19774), 'django_roles_access.utils.analyze_by_role', 'analyze_by_role', (['view_access'], {}), '(view_access)\n', (19761, 19774), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((20022, 20028), 'mock.Mock', 'Mock', ([], {}), '()\n', (20026, 20028), False, 'from mock import Mock, patch\n'), ((20188, 20284), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""fake-app-type"""', '"""fake-callback"""', '"""fake-view-name"""', '"""fake-site-active"""'], {}), "('fake-app-type', 'fake-callback', 'fake-view-name',\n    'fake-site-active')\n", (20208, 20284), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((20567, 20573), 'mock.Mock', 'Mock', ([], {}), '()\n', (20571, 20573), False, 'from mock import Mock, patch\n'), ((20724, 20820), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""fake-app-type"""', '"""fake-callback"""', '"""fake-view-name"""', '"""fake-site-active"""'], {}), "('fake-app-type', 'fake-callback', 'fake-view-name',\n    'fake-site-active')\n", (20744, 20820), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((21013, 21019), 'mock.Mock', 'Mock', ([], {}), '()\n', (21017, 21019), False, 'from mock import Mock, patch\n'), ((21170, 21266), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""fake-app-type"""', '"""fake-callback"""', '"""fake-view-name"""', '"""fake-site-active"""'], {}), "('fake-app-type', 'fake-callback', 'fake-view-name',\n    'fake-site-active')\n", (21190, 21266), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((21475, 21481), 'mock.Mock', 'Mock', ([], {}), '()\n', (21479, 21481), False, 'from mock import Mock, patch\n'), ((21632, 21728), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""fake-app-type"""', '"""fake-callback"""', '"""fake-view-name"""', '"""fake-site-active"""'], {}), "('fake-app-type', 'fake-callback', 'fake-view-name',\n    'fake-site-active')\n", (21652, 21728), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((22014, 22020), 'mock.Mock', 'Mock', ([], {}), '()\n', (22018, 22020), False, 'from mock import Mock, patch\n'), ((22180, 22258), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""fake-app-type"""', '"""fake-callback"""', '"""fake-view-name"""', '(True)'], {}), "('fake-app-type', 'fake-callback', 'fake-view-name', True)\n", (22200, 22258), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((22539, 22545), 'mock.Mock', 'Mock', ([], {}), '()\n', (22543, 22545), False, 'from mock import Mock, patch\n'), ((22696, 22774), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""fake-app-type"""', '"""fake-callback"""', '"""fake-view-name"""', '(True)'], {}), "('fake-app-type', 'fake-callback', 'fake-view-name', True)\n", (22716, 22774), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((23051, 23057), 'mock.Mock', 'Mock', ([], {}), '()\n', (23055, 23057), False, 'from mock import Mock, patch\n'), ((23208, 23286), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""fake-app-type"""', '"""fake-callback"""', '"""fake-view-name"""', '(True)'], {}), "('fake-app-type', 'fake-callback', 'fake-view-name', True)\n", (23228, 23286), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((23593, 23599), 'mock.Mock', 'Mock', ([], {}), '()\n', (23597, 23599), False, 'from mock import Mock, patch\n'), ((23750, 23828), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""fake-app-type"""', '"""fake-callback"""', '"""fake-view-name"""', '(True)'], {}), "('fake-app-type', 'fake-callback', 'fake-view-name', True)\n", (23770, 23828), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((24205, 24272), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['None', '"""fake-callback"""', '"""fake-view-name"""', '(True)'], {}), "(None, 'fake-callback', 'fake-view-name', True)\n", (24225, 24272), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((24633, 24709), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""NOT_SECURED"""', '"""fake-callback"""', '"""fake-view-name"""', '(True)'], {}), "('NOT_SECURED', 'fake-callback', 'fake-view-name', True)\n", (24653, 24709), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((25064, 25137), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""DISABLED"""', '"""fake-callback"""', '"""fake-view-name"""', '(True)'], {}), "('DISABLED', 'fake-callback', 'fake-view-name', True)\n", (25084, 25137), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((25490, 25562), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""SECURED"""', '"""fake-callback"""', '"""fake-view-name"""', '(True)'], {}), "('SECURED', 'fake-callback', 'fake-view-name', True)\n", (25510, 25562), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((25913, 25984), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""PUBLIC"""', '"""fake-callback"""', '"""fake-view-name"""', '(True)'], {}), "('PUBLIC', 'fake-callback', 'fake-view-name', True)\n", (25933, 25984), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((26323, 26329), 'mock.Mock', 'Mock', ([], {}), '()\n', (26327, 26329), False, 'from mock import Mock, patch\n'), ((26489, 26561), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""fake-app-type"""', 'function', '"""fake-view-name"""', '(False)'], {}), "('fake-app-type', function, 'fake-view-name', False)\n", (26509, 26561), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((27025, 27031), 'mock.Mock', 'Mock', ([], {}), '()\n', (27029, 27031), False, 'from mock import Mock, patch\n'), ((27191, 27263), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""fake-app-type"""', 'function', '"""fake-view-name"""', '(False)'], {}), "('fake-app-type', function, 'fake-view-name', False)\n", (27211, 27263), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((27686, 27751), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""PUBLIC"""', 'function', '"""fake-view-name"""', '(False)'], {}), "('PUBLIC', function, 'fake-view-name', False)\n", (27706, 27751), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((28221, 28282), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['None', 'function', '"""fake-view-name"""', '(False)'], {}), "(None, function, 'fake-view-name', False)\n", (28241, 28282), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((28749, 28818), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""Authorized"""', 'function', '"""fake-view-name"""', '(False)'], {}), "('Authorized', function, 'fake-view-name', False)\n", (28769, 28818), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((29079, 29195), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""SECURED"""', 'views.MiddlewareView.as_view', '"""django_roles_access:middleware_view_class"""', '(True)'], {}), "('SECURED', views.MiddlewareView.as_view,\n    'django_roles_access:middleware_view_class', True)\n", (29099, 29195), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((29353, 29443), 'django_roles_access.models.ViewAccess.objects.create', 'ViewAccess.objects.create', ([], {'view': '"""django_roles_access:middleware_view_class"""', 'type': '"""br"""'}), "(view='django_roles_access:middleware_view_class',\n    type='br')\n", (29378, 29443), False, 'from django_roles_access.models import ViewAccess\n'), ((29482, 29602), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""NOT_SECURED"""', 'views.MiddlewareView.as_view', '"""django_roles_access:middleware_view_class"""', '(True)'], {}), "('NOT_SECURED', views.MiddlewareView.as_view,\n    'django_roles_access:middleware_view_class', True)\n", (29502, 29602), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((29776, 29866), 'django_roles_access.models.ViewAccess.objects.create', 'ViewAccess.objects.create', ([], {'view': '"""django_roles_access:middleware_view_class"""', 'type': '"""pu"""'}), "(view='django_roles_access:middleware_view_class',\n    type='pu')\n", (29801, 29866), False, 'from django_roles_access.models import ViewAccess\n'), ((29905, 30022), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""DISABLED"""', 'views.MiddlewareView.as_view', '"""django_roles_access:middleware_view_class"""', '(True)'], {}), "('DISABLED', views.MiddlewareView.as_view,\n    'django_roles_access:middleware_view_class', True)\n", (29925, 30022), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((30307, 30397), 'django_roles_access.models.ViewAccess.objects.create', 'ViewAccess.objects.create', ([], {'view': '"""django_roles_access:middleware_view_class"""', 'type': '"""br"""'}), "(view='django_roles_access:middleware_view_class',\n    type='br')\n", (30332, 30397), False, 'from django_roles_access.models import ViewAccess\n'), ((30436, 30552), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""SECURED"""', 'views.MiddlewareView.as_view', '"""django_roles_access:middleware_view_class"""', '(True)'], {}), "('SECURED', views.MiddlewareView.as_view,\n    'django_roles_access:middleware_view_class', True)\n", (30456, 30552), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((30832, 30873), 'django.contrib.auth.models.Group.objects.get_or_create', 'Group.objects.get_or_create', ([], {'name': '"""test1"""'}), "(name='test1')\n", (30859, 30873), False, 'from django.contrib.auth.models import Group\n'), ((30896, 30937), 'django.contrib.auth.models.Group.objects.get_or_create', 'Group.objects.get_or_create', ([], {'name': '"""test2"""'}), "(name='test2')\n", (30923, 30937), False, 'from django.contrib.auth.models import Group\n'), ((30960, 31050), 'django_roles_access.models.ViewAccess.objects.create', 'ViewAccess.objects.create', ([], {'view': '"""django_roles_access:middleware_view_class"""', 'type': '"""br"""'}), "(view='django_roles_access:middleware_view_class',\n    type='br')\n", (30985, 31050), False, 'from django_roles_access.models import ViewAccess\n'), ((31184, 31300), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""SECURED"""', 'views.MiddlewareView.as_view', '"""django_roles_access:middleware_view_class"""', '(True)'], {}), "('SECURED', views.MiddlewareView.as_view,\n    'django_roles_access:middleware_view_class', True)\n", (31204, 31300), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((31514, 31604), 'django_roles_access.models.ViewAccess.objects.create', 'ViewAccess.objects.create', ([], {'view': '"""django_roles_access:middleware_view_class"""', 'type': '"""au"""'}), "(view='django_roles_access:middleware_view_class',\n    type='au')\n", (31539, 31604), False, 'from django_roles_access.models import ViewAccess\n'), ((31643, 31759), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""SECURED"""', 'views.MiddlewareView.as_view', '"""django_roles_access:middleware_view_class"""', '(True)'], {}), "('SECURED', views.MiddlewareView.as_view,\n    'django_roles_access:middleware_view_class', True)\n", (31663, 31759), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((31965, 32055), 'django_roles_access.models.ViewAccess.objects.create', 'ViewAccess.objects.create', ([], {'view': '"""django_roles_access:middleware_view_class"""', 'type': '"""pu"""'}), "(view='django_roles_access:middleware_view_class',\n    type='pu')\n", (31990, 32055), False, 'from django_roles_access.models import ViewAccess\n'), ((32094, 32210), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""SECURED"""', 'views.MiddlewareView.as_view', '"""django_roles_access:middleware_view_class"""', '(True)'], {}), "('SECURED', views.MiddlewareView.as_view,\n    'django_roles_access:middleware_view_class', True)\n", (32114, 32210), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((32482, 32573), 'django_roles_access.models.ViewAccess.objects.create', 'ViewAccess.objects.create', ([], {'view': '"""django_roles_access:view_protected_by_role"""', 'type': '"""br"""'}), "(view='django_roles_access:view_protected_by_role',\n    type='br')\n", (32507, 32573), False, 'from django_roles_access.models import ViewAccess\n'), ((32612, 32730), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""SECURED"""', 'views.protected_view_by_role', '"""django_roles_access:view_protected_by_role"""', '(False)'], {}), "('SECURED', views.protected_view_by_role,\n    'django_roles_access:view_protected_by_role', False)\n", (32632, 32730), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((33013, 33054), 'django.contrib.auth.models.Group.objects.get_or_create', 'Group.objects.get_or_create', ([], {'name': '"""test1"""'}), "(name='test1')\n", (33040, 33054), False, 'from django.contrib.auth.models import Group\n'), ((33077, 33118), 'django.contrib.auth.models.Group.objects.get_or_create', 'Group.objects.get_or_create', ([], {'name': '"""test2"""'}), "(name='test2')\n", (33104, 33118), False, 'from django.contrib.auth.models import Group\n'), ((33141, 33232), 'django_roles_access.models.ViewAccess.objects.create', 'ViewAccess.objects.create', ([], {'view': '"""django_roles_access:view_protected_by_role"""', 'type': '"""br"""'}), "(view='django_roles_access:view_protected_by_role',\n    type='br')\n", (33166, 33232), False, 'from django_roles_access.models import ViewAccess\n'), ((33366, 33484), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""SECURED"""', 'views.protected_view_by_role', '"""django_roles_access:view_protected_by_role"""', '(False)'], {}), "('SECURED', views.protected_view_by_role,\n    'django_roles_access:view_protected_by_role', False)\n", (33386, 33484), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((33701, 33792), 'django_roles_access.models.ViewAccess.objects.create', 'ViewAccess.objects.create', ([], {'view': '"""django_roles_access:view_protected_by_role"""', 'type': '"""au"""'}), "(view='django_roles_access:view_protected_by_role',\n    type='au')\n", (33726, 33792), False, 'from django_roles_access.models import ViewAccess\n'), ((33831, 33949), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""SECURED"""', 'views.protected_view_by_role', '"""django_roles_access:view_protected_by_role"""', '(False)'], {}), "('SECURED', views.protected_view_by_role,\n    'django_roles_access:view_protected_by_role', False)\n", (33851, 33949), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((34158, 34249), 'django_roles_access.models.ViewAccess.objects.create', 'ViewAccess.objects.create', ([], {'view': '"""django_roles_access:view_protected_by_role"""', 'type': '"""pu"""'}), "(view='django_roles_access:view_protected_by_role',\n    type='pu')\n", (34183, 34249), False, 'from django_roles_access.models import ViewAccess\n'), ((34288, 34406), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""SECURED"""', 'views.protected_view_by_role', '"""django_roles_access:view_protected_by_role"""', '(False)'], {}), "('SECURED', views.protected_view_by_role,\n    'django_roles_access:view_protected_by_role', False)\n", (34308, 34406), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((34647, 34765), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['"""SECURED"""', 'views.protected_view_by_role', '"""django_roles_access:view_protected_by_role"""', '(False)'], {}), "('SECURED', views.protected_view_by_role,\n    'django_roles_access:view_protected_by_role', False)\n", (34667, 34765), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((35016, 35129), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['None', 'views.protected_view_by_role', '"""django_roles_access:view_protected_by_role"""', '(False)'], {}), "(None, views.protected_view_by_role,\n    'django_roles_access:view_protected_by_role', False)\n", (35036, 35129), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((35514, 35603), 'django_roles_access.models.ViewAccess.objects.create', 'ViewAccess.objects.create', ([], {'view': '"""django_roles_access:middleware_view_func"""', 'type': '"""pu"""'}), "(view='django_roles_access:middleware_view_func',\n    type='pu')\n", (35539, 35603), False, 'from django_roles_access.models import ViewAccess\n'), ((35642, 35746), 'django_roles_access.utils.view_access_analyzer', 'view_access_analyzer', (['None', 'views.middleware_view', '"""django_roles_access:middleware_view_func"""', '(False)'], {}), "(None, views.middleware_view,\n    'django_roles_access:middleware_view_func', False)\n", (35662, 35746), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((36166, 36213), 'django_roles_access.utils.OutputReport', 'OutputReport', (['self.mock_stdout', 'self.mock_style'], {}), '(self.mock_stdout, self.mock_style)\n', (36178, 36213), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((8369, 8405), 'importlib.import_module', 'import_module', (['settings.ROOT_URLCONF'], {}), '(settings.ROOT_URLCONF)\n', (8382, 8405), False, 'from importlib import import_module\n'), ((11731, 11753), 'django_roles_access.utils.get_views_by_app', 'get_views_by_app', (['data'], {}), '(data)\n', (11747, 11753), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((12067, 12089), 'django_roles_access.utils.get_views_by_app', 'get_views_by_app', (['data'], {}), '(data)\n', (12083, 12089), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((13496, 13532), 'importlib.import_module', 'import_module', (['settings.ROOT_URLCONF'], {}), '(settings.ROOT_URLCONF)\n', (13509, 13532), False, 'from importlib import import_module\n'), ((13809, 13832), 'django_roles_access.utils.walk_site_url', 'walk_site_url', (['self.url'], {}), '(self.url)\n', (13822, 13832), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((14209, 14232), 'django_roles_access.utils.walk_site_url', 'walk_site_url', (['self.url'], {}), '(self.url)\n', (14222, 14232), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((14588, 14611), 'django_roles_access.utils.walk_site_url', 'walk_site_url', (['self.url'], {}), '(self.url)\n', (14601, 14611), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((15015, 15038), 'django_roles_access.utils.walk_site_url', 'walk_site_url', (['self.url'], {}), '(self.url)\n', (15028, 15038), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((16360, 16396), 'django_roles_access.utils.check_django_roles_is_used', 'check_django_roles_is_used', (['function'], {}), '(function)\n', (16386, 16396), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((16717, 16750), 'django_roles_access.utils.check_django_roles_is_used', 'check_django_roles_is_used', (['Aview'], {}), '(Aview)\n', (16743, 16750), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((16908, 16941), 'django_roles_access.utils.check_django_roles_is_used', 'check_django_roles_is_used', (['Aview'], {}), '(Aview)\n', (16934, 16941), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n'), ((35935, 35948), 'django.core.management.BaseCommand', 'BaseCommand', ([], {}), '()\n', (35946, 35948), False, 'from django.core.management import BaseCommand\n'), ((36004, 36017), 'django.core.management.BaseCommand', 'BaseCommand', ([], {}), '()\n', (36015, 36017), False, 'from django.core.management import BaseCommand\n'), ((36806, 36820), 'django_roles_access.utils.OutputReport', 'OutputReport', ([], {}), '()\n', (36818, 36820), False, 'from django_roles_access.utils import walk_site_url, get_views_by_app, view_access_analyzer, get_view_analyze_report, check_django_roles_is_used, analyze_by_role, APP_NAME_FOR_NONE, NOT_SECURED_DEFAULT, SECURED_DEFAULT, PUBLIC_DEFAULT, NONE_TYPE_DEFAULT, DISABLED_DEFAULT, OutputReport\n')]