Module Import alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias ClassDef bases NameLoad body Assign NameStore ListLoad Str Str Assign NameStore Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list decorator_list Call NameLoad keyword Str keyword TupleLoad Str Str Str Str Str Str keyword TupleLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str keyword Num
N/A N/A os django.conf settings django.contrib.auth.models User django.test TestCase Client django.test.utils override_settings FlatpageCSRFTests N/A TestCase N/A N/A fixtures N/A sample_flatpages example_site N/A urls django.contrib.flatpages.tests.urls setUp N/A N/A self N/A N/A N/A N/A self client N/A Client enforce_csrf_checks True N/A test_view_flatpage N/A N/A self N/A N/A N/A A flatpage can be served through a view, even when the middleware is in use N/A response N/A N/A N/A self client get /flatpage_root/flatpage/ N/A N/A N/A self assertEqual N/A response status_code 200 N/A N/A N/A self assertContains response <p>Isn't it flat!</p> N/A test_view_non_existent_flatpage N/A N/A self N/A N/A N/A A non-existent flatpage raises 404 when served through a view, even when the middleware is in use N/A response N/A N/A N/A self client get /flatpage_root/no_such_flatpage/ N/A N/A N/A self assertEqual N/A response status_code 404 N/A test_view_authenticated_flatpage N/A N/A self N/A N/A N/A A flatpage served through a view can require authentication N/A response N/A N/A N/A self client get /flatpage_root/sekrit/ N/A N/A N/A self assertRedirects response /accounts/login/?next=/flatpage_root/sekrit/ N/A N/A N/A N/A User objects create_user testuser test@example.com s3krit N/A N/A N/A N/A self client login username testuser password s3krit N/A response N/A N/A N/A self client get /flatpage_root/sekrit/ N/A N/A N/A self assertEqual N/A response status_code 200 N/A N/A N/A self assertContains response <p>Isn't it sekrit!</p> N/A test_fallback_flatpage N/A N/A self N/A N/A N/A A flatpage can be served by the fallback middlware N/A response N/A N/A N/A self client get /flatpage/ N/A N/A N/A self assertEqual N/A response status_code 200 N/A N/A N/A self assertContains response <p>Isn't it flat!</p> N/A test_fallback_non_existent_flatpage N/A N/A self N/A N/A N/A A non-existent flatpage raises a 404 when served by the fallback middlware N/A response N/A N/A N/A self client get /no_such_flatpage/ N/A N/A N/A self assertEqual N/A response status_code 404 N/A test_post_view_flatpage N/A N/A self N/A N/A N/A POSTing to a flatpage served through a view will raise a CSRF error if no token is provided (Refs #14156) N/A response N/A N/A N/A self client post /flatpage_root/flatpage/ N/A N/A N/A self assertEqual N/A response status_code 403 N/A test_post_fallback_flatpage N/A N/A self N/A N/A N/A POSTing to a flatpage served by the middleware will raise a CSRF error if no token is provided (Refs #14156) N/A response N/A N/A N/A self client post /flatpage/ N/A N/A N/A self assertEqual N/A response status_code 403 N/A test_post_unknown_page N/A N/A self N/A N/A N/A POSTing to an unknown page isn't caught as a 403 CSRF error N/A response N/A N/A N/A self client post /no_such_page/ N/A N/A N/A self assertEqual N/A response status_code 404 N/A N/A N/A override_settings LOGIN_URL /accounts/login/ MIDDLEWARE_CLASSES N/A django.middleware.common.CommonMiddleware django.contrib.sessions.middleware.SessionMiddleware django.middleware.csrf.CsrfViewMiddleware django.contrib.auth.middleware.AuthenticationMiddleware django.contrib.messages.middleware.MessageMiddleware django.contrib.flatpages.middleware.FlatpageFallbackMiddleware TEMPLATE_DIRS N/A N/A N/A N/A os path join N/A N/A N/A os path dirname __file__ templates SITE_ID 1