Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#14919 closed (fixed)

1.2.X branch test failure: test_csrf_token_in_404

Reported by: Karen Tracey Owned by: nobody
Component: Uncategorized Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This test (in views) passes in isolation but fails when run with model_inheritance:

No fixtures found.
test_abstract (modeltests.model_inheritance.tests.ModelInheritanceTests) ... ok
test_multiple_table (modeltests.model_inheritance.tests.ModelInheritanceTests) ... ok
test_create_article (regressiontests.views.tests.generic.create_update.AbsoluteUrlNoPostSave) ... ok
test_delete_article (regressiontests.views.tests.generic.create_update.AbsoluteUrlNoPostSave) ... ok
test_update_article (regressiontests.views.tests.generic.create_update.AbsoluteUrlNoPostSave) ... ok
test_create_article_display_page (regressiontests.views.tests.generic.create_update.CreateObjectTest) ... ok
test_create_article_with_errors (regressiontests.views.tests.generic.create_update.CreateObjectTest) ... ok
test_create_custom_save_article (regressiontests.views.tests.generic.create_update.CreateObjectTest) ... ok
test_login_required_view (regressiontests.views.tests.generic.create_update.CreateObjectTest) ... ok
test_year_month_day_format (regressiontests.views.tests.generic.date_based.DayArchiveTests) ... ok
test_404 (regressiontests.views.tests.debug.DebugViewTests) ... ok
test_files (regressiontests.views.tests.debug.DebugViewTests) ... ok
test_template_exceptions (regressiontests.views.tests.debug.DebugViewTests) ... ok
test_view_exceptions (regressiontests.views.tests.debug.DebugViewTests) ... ok
test_bad_content_type (regressiontests.views.tests.defaults.DefaultsTests) ... ok
test_csrf_token_in_404 (regressiontests.views.tests.defaults.DefaultsTests) ... ERROR
A model can set attributes on the get_absolute_url method ... ok
test_nonint_content_type (regressiontests.views.tests.defaults.DefaultsTests) ... ok
A 404 status is returned by the page_not_found view ... ok
The server_error view raises a 500 status ... ok
test_shortcut_bad_pk (regressiontests.views.tests.defaults.DefaultsTests) ... ok
Shortcuts for an object that has no get_absolute_url method raises 404 ... ok
Can view a shortcut for an Author object that has a get_absolute_url method ... ok
test_wrong_type_pk (regressiontests.views.tests.defaults.DefaultsTests) ... ok
The javascript_catalog can be deployed with language settings ... ok
The set_language view can be used to change the session language ... ok
testI18NLanguageNonEnglishDefault (regressiontests.views.tests.i18n.JsI18NTests) ... ok
testI18NLanguageNonEnglishFallback (regressiontests.views.tests.i18n.JsI18NTests) ... ok
test_jsi18n_fallback_language (regressiontests.views.tests.i18n.JsI18NTests) ... ok
test_jsi18n_with_missing_en_files (regressiontests.views.tests.i18n.JsI18NTests) ... ok
test_nonenglish_default_english_userpref (regressiontests.views.tests.i18n.JsI18NTests) ... ok
testI18NDifferentNonEnLangs (regressiontests.views.tests.i18n.JsI18NTestsMultiPackage) ... ok
testI18NLanguageEnglishDefault (regressiontests.views.tests.i18n.JsI18NTestsMultiPackage) ... ok
test_archive_month_date_list (regressiontests.views.tests.generic.date_based.MonthArchiveTest) ... ok
Regression for #3031: Archives around Feburary include only one month ... ok
test_create_article (regressiontests.views.tests.generic.create_update.NoPostSaveNoAbsoluteUrl) ... ok
test_delete_article (regressiontests.views.tests.generic.create_update.NoPostSaveNoAbsoluteUrl) ... ok
test_update_article (regressiontests.views.tests.generic.create_update.NoPostSaveNoAbsoluteUrl) ... ok
date_based.object_detail can view a page in the past ... ok
date_based.object_detail can view a page from the future if explicitly allowed. ... ok
date_based.object_detail can view a page from today ... ok
date_based.object_detail can view a page from the future, but only if allowed. ... ok
test_create_article (regressiontests.views.tests.generic.create_update.PostSaveRedirectTests) ... ok
test_delete_article (regressiontests.views.tests.generic.create_update.PostSaveRedirectTests) ... ok
test_update_article (regressiontests.views.tests.generic.create_update.PostSaveRedirectTests) ... ok
test_copes_with_empty_path_component (regressiontests.views.tests.static.StaticTests) ... ok
Handle bogus If-Modified-Since values gracefully ... ok
Handle even more bogus If-Modified-Since values gracefully ... ok
test_is_modified_since (regressiontests.views.tests.static.StaticTests) ... ok
test_not_modified_since (regressiontests.views.tests.static.StaticTests) ... ok
The static view can serve static media ... ok
test_unknown_mime_type (regressiontests.views.tests.static.StaticTests) ... ok
test_combining_redirect (regressiontests.views.tests.specials.URLHandling) ... ok
test_nonascii_redirect (regressiontests.views.tests.specials.URLHandling) ... ok
test_permanent_nonascii_redirect (regressiontests.views.tests.specials.URLHandling) ... ok
test_delete_object (regressiontests.views.tests.generic.create_update.UpdateDeleteObjectTest) ... ok
test_delete_object_confirm (regressiontests.views.tests.generic.create_update.UpdateDeleteObjectTest) ... ok
test_update_object (regressiontests.views.tests.generic.create_update.UpdateDeleteObjectTest) ... ok
test_update_object_form_display (regressiontests.views.tests.generic.create_update.UpdateDeleteObjectTest) ... ok

======================================================================
ERROR: test_csrf_token_in_404 (regressiontests.views.tests.defaults.DefaultsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kmtracey/django/branch1.2.X/tests/regressiontests/views/tests/defaults.py", line 65, in test_csrf_token_in_404
    csrf_token = response.context['csrf_token']
  File "/home/kmtracey/django/branch1.2.X/django/template/context.py", line 46, in __getitem__
    raise KeyError(key)
KeyError: 'csrf_token'

----------------------------------------------------------------------
Ran 59 tests in 2.068s

FAILED (errors=1)
Destroying test database 'default'...
Destroying test database 'other'...

I see the failure only on 1.2.X, not trunk.

Change History (2)

comment:1 by Luke Plant, 14 years ago

Resolution: fixed
Status: newclosed

(In [14930]) [1.2.X] Fixed #14919 - test isolation issue with model_inheritance.ModelInheritanceTests.test_multiple_table and views.DefaultsTests.test_csrf_token_in_404

test_csrf_token_in_404 was assuming DEBUG = False, and test_multiple_table
was leaving DEBUG = True. Both issues have been fixed.

comment:2 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top