Commit Graph

62 Commits

Author SHA1 Message Date
Luke Plant 45e55b9143 Fixed #14614 - filtering of sensitive information in 500 error reports.
This adds a flexible mechanism for filtering what request/traceback
information is shown in 500 error emails and logs. It also applies
screening to some views known to be sensitive e.g. views that handle
passwords.

Thanks to oaylanc for the report and many thanks to Julien Phalip for the
patch and the rest of the work on this.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16339 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-08 22:18:46 +00:00
Ramiro Morales 0065d8a120 Made expected output platform-independent in a test for the template postmortem debug 500 view so it doesn't fail under Windows.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16277 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-24 21:33:32 +00:00
Luke Plant 4d039d8d05 Fixed #15980 - Unknown encoding "utf8" in tests/regressiontests/views/__init__.py
Thanks to davidbarnett2 for the report

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16170 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-07 10:47:11 +00:00
Jannis Leidel b0d274dbd5 Added missing future imports missed in r16167.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16169 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-06 19:49:06 +00:00
Jannis Leidel 7dd72360a2 Make use of new translation and settings context manager in the tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16167 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-06 13:29:44 +00:00
Carl Meyer 04654e554f Refs #15903 -- Added a per-TestCase urlconf to reduce coupling between test apps.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16107 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-27 15:47:16 +00:00
Russell Keith-Magee 29642fa76f Refactored views regression tests to isolate generic views from the root URL space.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16000 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-02 13:27:40 +00:00
Russell Keith-Magee 4c468800ee Updates to the test suite to allow for newly deprecated and removed features
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15990 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-02 08:44:47 +00:00
Russell Keith-Magee afd040d4d3 Updated test assertions that have been deprecated by the move to unittest2. In summary, this means:
assert_ -> assertTrue
 assertEquals -> assertEqual
 failUnless -> assertTrue

For full details, see http://www.voidspace.org.uk/python/articles/unittest2.shtml#deprecations

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15728 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-03 15:04:39 +00:00
Jannis Leidel 6b95aa6fb5 Fixed #15531 -- Partially reverted [15701] due to compatibility issues with middlewares that modify content of responses. Thanks for the report, schinckel. Refs #15281.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15703 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-02 10:40:48 +00:00
Jannis Leidel be4a2e3f3e Fixed #15281 -- Made the static view use an iterator when serving a file, effectively making this less of a memory hog. Also use the appropriate attributes of the stat object instead of indexes. Thanks for the initial patch, FunkyBob and aaugustin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15701 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-01 22:49:10 +00:00
Luke Plant dbe6ced0d6 Fixed #717 - If-Modified-Since handling should compare dates according to RFC 2616
Thanks to Maniac for the report, julienb for the initial patch, and
especially to aaugustin for the final patch and tests.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15696 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-01 14:28:06 +00:00
Alex Gaynor 9ebc9108de Fix the test isolation from [15552].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15553 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-16 15:44:13 +00:00
Jannis Leidel ada08cd6d8 Fixed #15314 -- Added tests for the static URL pattern function added in r15530 and made sure the **kwargs are passed to the view correctly. Thanks for the report and initial patch, Bruno Renié.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15552 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-16 12:50:57 +00:00
Ramiro Morales f6e38f3800 Fixed #5494, #10765, #14924 -- Modified the order in which translations are read when composing the final translation to offer at runtime.
This is slightly backward-incompatible (could result in changed final translations for literals appearing multiple times in different .po files but with different translations).

Translations are now read in the following order (from lower to higher priority):

For the 'django' gettext domain:

 * Django translations
 * INSTALLED_APPS apps translations (with the ones listed first having higher priority)
 * settings/project path translations (deprecated, see below)
 * LOCALE_PATHS translations (with the ones listed first having higher priority)

For the 'djangojs' gettext domain:

 * Python modules whose names are passed to the javascript_catalog view
 * LOCALE_PATHS translations (with the ones listed first having higher priority, previously they weren't included)

Also, automatic loading of translations from the 'locale' subdir of the settings/project path is now deprecated.

Thanks to vanschelven, vbmendes and an anonymous user for reporting issues, to vanschelven, Claude Paroz and an anonymous contributor for their initial work on fixes and to Jannis  Leidel and Claude for review and discussion.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15441 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-07 18:48:40 +00:00
Russell Keith-Magee 67a2bb6341 Modified the test case from r15383 to avoid an output inconsistency with KeyError.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15387 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-01 15:13:56 +00:00
Russell Keith-Magee 9a82eb6ff1 Fixed #14972 -- Ensure that the HTML email logger always produces useful output, regardless of whether it has been given an exception or a request. Thanks to jamstooks for the report, and bpeschier for the initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15383 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-01 14:18:07 +00:00
Ramiro Morales 19bfdadc43 Fixed #15122 -- Restored reporting of the template files tried in the texmplate loader post mortem section of the TemplateDoesNotExit 500 error debug page. Thanks rdrey for reporting this regression.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15252 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-20 22:33:58 +00:00
Luke Plant 80f4826063 Fixed #15025 - template debug fails if there's a callable local var that generates an exception
Thanks to Tai Lee for the patch and report, also to Don Spaulding.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15187 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-13 13:47:03 +00:00
Jannis Leidel a3894945b6 Fixed #15010 -- Added current_app parameter to close gap between TemplateResponse and render method. Thanks, acdha.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15153 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-05 22:41:43 +00:00
Russell Keith-Magee 0fef92f6f0 Fixed #14936 -- Tweaked the new render shortcut to reflect non-legacy arguments. Thanks to adamv for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15020 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-22 04:54:10 +00:00
Russell Keith-Magee b3d2091681 Fixed #12816 -- Added a render() shortcut.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15008 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-21 17:18:41 +00:00
Jannis Leidel 6ec348fb41 Fixed #13726 -- Further refine changes made in r12384 and r13069 for using non-English source languages in JavaScript translation catalogues. Thanks, Ramiro.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14901 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-13 13:52:52 +00:00
Russell Keith-Magee e0dcd7666a Fixed #12815 -- Added TemplateResponse, a lazy-evaluated Response class. Thanks to Simon Willison for the original idea, and to Mikhail Korobov and Ivan Sagalaev for their assistance, including the draft patch from Mikhail.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14850 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-07 13:57:01 +00:00
Alex Gaynor 5bc0ec4ec4 Removed all usages of deprecated TestCase methods (self.fail*). This removed most of the Warnings emitted (with -Wall) during the test suite.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14803 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-04 07:28:12 +00:00
Ramiro Morales 0714b0f390 Fixed #14812 -- Made parsing of the If-Modified-Since HTTP header more robust in presence of malformed values when serving static content. Thanks shaohua for the report, and alexey.smolsky@gmail.com for a similar report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14753 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-30 21:27:26 +00:00
Jannis Leidel 83aeb3c768 Fixed #9988 -- Added support for translation contexts. Thanks, Claude Paroz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14450 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-04 10:48:27 +00:00
Luke Plant 90ac02300e Fixed #14565 - No csrf_token on 404 page.
This solution doesn't have the negative side-effects of [14356].

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14377 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-28 11:47:15 +00:00
Jannis Leidel 1c4868f4c1 Fixed #14507 -- Corrected the logic of the URL helpers and view of staticfiles to actual work like documented (only when settings.DEBUG is True). Thanks for the report and initial patch, mbi.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14306 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-21 03:16:41 +00:00
Jannis Leidel d69c7eab04 Fixed #13897 -- Added tests for pagination feature of the generic object_list view. Thanks, d0ugal and SmileyChris.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13965 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-01 02:01:20 +00:00
Jannis Leidel 94096e83e9 Fixed #12544 and #13600 -- Fixed static files serving view to catch invalid date from If-Modified-Since header. Thanks akaihola and SmileyChris for patches.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13870 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-26 20:44:56 +00:00
Jannis Leidel a686096c26 Fixed #7535 -- Correctly set Content-Encoding header in static files serving view. Thanks for the report and patch, Kevin Hunter.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13868 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-26 15:10:41 +00:00
Malcolm Tredinnick fffe0a00a3 Add option to redirect_to view to allow passing along the query string
from the original request. Default is current behaviour, which is not to
pass the query string (it often won't be appropriate to do so).

Thanks to steingrd@ifi.uio.no for the patch and tests. Fixed #9966.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13746 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-11 03:13:23 +00:00
Russell Keith-Magee 21e84194b5 Fixed #13514 -- Corrected the process of loading multiple javascript translation catalogs. Thanks to jtiai for the report, to Ramiro Morales for working out the test case, and to Ramiro and Jannis for their help on the fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13250 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-13 13:29:31 +00:00
Karen Tracey b2db1b24c6 Fixed #12764: Avoid exceeding psycopg1 limits in the views tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12832 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-22 13:22:24 +00:00
Russell Keith-Magee 203d0f6048 Fixed #11891 -- Ensured that attributes of get_absolute_url are preserved through the metaclass. Thanks to nfg for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12766 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-12 14:36:39 +00:00
Karen Tracey fa3b4a47ef Add files mistakenly left out of r12725.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12726 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-08 17:04:06 +00:00
Karen Tracey 50e46c017e Fixed #11461: Ensured complete traceback is available on the debug page when an exception is encountered during template rendering, even when running on Python 2.6 or higher. Thanks Glenn.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12725 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-08 17:01:21 +00:00
Karen Tracey 5a35619b5b Move the tests added for #12302 to where some other tests for debug page responses already existed.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12723 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-08 15:20:29 +00:00
Karen Tracey eb11229ba7 Fixed #12083: Ensured generating debug 404 page won't raise a key error. Thanks pigletto.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12679 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-05 18:53:07 +00:00
Karen Tracey 125c748cf6 Fixed #11522: Restored ability of http redirect responses to correctly handle redirect locations with non-ASCII chars.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12659 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-02 19:37:48 +00:00
Jannis Leidel 12d40a9fd6 Fixed #11384 - Make sure translations in the project directory really override translations in apps as specified in the docs.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12447 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-16 12:17:17 +00:00
Jannis Leidel 8600ad4c50 Fixed #3594 - Added ability to discard the language catalog in the JavaScript i18n view in case the selected language is English but no English translation catalog actual exists, e.g. due to being the language translated from. Thanks to msaelices, aryx and Ramiro Morales.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12384 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-05 01:43:13 +00:00
Karen Tracey b45fd3ffdf Fixed: 3274: Added date_list context variable to the archive_month generic view, consistent with archive_index and archive_year. Thanks Sean Brant.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12195 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-10 19:52:17 +00:00
Joseph Kocherhans 471596fc1a Merged soc2009/model-validation to trunk. Thanks, Honza!
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12098 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-05 03:56:19 +00:00
Jannis Leidel 6eb02fa9bb Fixed #12448 - Make sure format strings are handled correctly as unicode.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12028 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-30 22:11:11 +00:00
Luke Plant 25ab93457c Fixed #10927 - Content Types shortcut view throws 500s instead of 404s
Thanks to Jeremy Dunck/Alex Gaynor for the patch



git-svn-id: http://code.djangoproject.com/svn/django/trunk@11917 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-19 15:25:16 +00:00
Karen Tracey ff38e0b1d1 Fixed #12125 -- Fixed a typo in the generic views date_based test that caused it to fail in November. Thanks brutasse.
--This line and those below, will be ignored--

M    tests/regressiontests/views/tests/generic/date_based.py


git-svn-id: http://code.djangoproject.com/svn/django/trunk@11697 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-11-01 22:12:40 +00:00
Russell Keith-Magee 6cc0c3887c Fixed #10458 -- Corrected the `next_month` and `previous_month` context variables provided with the generic month_archive view. The value returned now matches the docstring and the generic views documentation. Thanks to fperetti for the report and initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10556 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-13 13:23:03 +00:00
Malcolm Tredinnick 87e6939372 Fixed #10267 -- Correctly handle IRIs in HttpResponse.build_absolute_uri().
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-12 03:50:47 +00:00