Commit Graph

75 Commits

Author SHA1 Message Date
Alex Gaynor 7548aa8ffd More attacking E302 violators 2013-11-02 13:12:09 -07:00
Boryslav Larin e737c009b8 Fixed flake8 E241 2013-11-02 21:45:40 +02:00
Alex Gaynor 9bf5610890 Start attacking E231 violations 2013-10-24 10:30:03 -07:00
Alasdair Nicol c3aa2948c6 Fixed #21298 -- Fixed E301 pep8 warnings 2013-10-23 13:45:03 +01:00
Alasdair Nicol b289fcf1bf Fixed #21288 -- Fixed E126 pep8 warnings 2013-10-21 08:31:30 -04:00
Alasdair Nicol bab9123daa Fixed #21268 -- Fixed E303 pep8 warnings 2013-10-18 01:46:24 +01:00
Unai Zalakain c7634cd7fe Fixed #7603 -- Added a 'scheme' property to the HttpRequest object
`HttpRequest.scheme` is `https` if `settings.SECURE_PROXY_SSL_HEADER` is
appropriately set and falls back to `HttpRequest._get_scheme()` (a hook
for subclasses to implement) otherwise.

`WSGIRequest._get_scheme()` makes use of the `wsgi.url_scheme` WSGI
environ variable to determine the request scheme.

`HttpRequest.is_secure()` simply checks if `HttpRequest.scheme` is
`https`.

This provides a way to check the current scheme in templates, for example.
It also allows us to deal with other schemes.

Thanks nslater for the suggestion.
2013-10-15 09:04:12 -04:00
Tim Graham 1dae4ac177 Whitespace cleanup.
* Removed trailing whitespace.
* Added newline to EOF if missing.
* Removed blank lines at EOF.
* Removed some stray tabs.
2013-10-10 16:49:20 -04:00
Tim Graham adedc31072 Fixed "redefinition of unused 'foo' from line X" pyflakes warnings. 2013-10-10 11:09:42 -04:00
Simon Charette f5f662fa5f Fixed #21112 -- Make sure sitemaps with no lastmod date work correctly.
Thanks to Matthias Kestenholz for the report and patch.
2013-09-17 10:21:11 -04:00
Aymeric Augustin 6a6428a36f Took advantage of django.utils.six.moves.urllib.*. 2013-09-05 14:39:23 -05:00
Julian Bez 8f5533ab25 Fixed #20793 -- Added Last-Modified header to sitemaps. 2013-07-31 07:42:30 -04:00
Aymeric Augustin cfcf4b3605 Stopped using django.utils.unittest in the test suite.
Refs #20680.
2013-07-01 14:29:33 +02:00
Claude Paroz 6118d6d1c9 More import removals
Following the series of commits removing deprecated features in
Django 1.7, here are some more unneeded imports removed and other
minor cleanups.
2013-06-29 11:58:36 +02:00
Ramiro Morales 8eadbc5a03 Removed 'mimetype' arguments from a few places, as per deprecation TL.
This includes HttpResponse and co. __init__() methods,
django.shortcuts.render_to_response() and the index(), sitemap() sitemap
app views.
2013-06-28 21:48:16 -03:00
Aymeric Augustin ffcf24c9ce Removed several unused imports. 2013-06-19 17:18:40 +02:00
Ramiro Morales 0fa8d43e74 Replaced `and...or...` constructs with PEP 308 conditional expressions. 2013-05-26 23:47:50 -03:00
Carl Meyer 9012833af8 Fixed #17365, #17366, #18727 -- Switched to discovery test runner.
Thanks to Preston Timmons for the bulk of the work on the patch, especially
updating Django's own test suite to comply with the requirements of the new
runner. Thanks also to Jannis Leidel and Mahdi Yusuf for earlier work on the
patch and the discovery runner.

Refs #11077, #17032, and #18670.
2013-05-10 23:08:45 -04:00
Claude Paroz f3b3c569e7 One more changed import location of wraps 2013-05-04 13:29:40 +02:00
Claude Paroz 66c83dce07 Fixed #18351 -- Added X-Robots-Tag header to sitemaps
Thanks Michael Lissner for the report and initial patch, and
Tom Mortimer-Jones for working on the patch.
2013-05-04 12:08:15 +02:00
Preston Timmons e3cfbaaca4 Modified sitemaps to work with unittest2 discovery. 2013-04-02 20:12:35 -06:00
Russell Keith-Magee 930af661ab Fixed #20048, #20060 -- Modified tests for contrib apps sensitive to custom User models.
Thanks to matiasb for the report of #20060 and the draft patch for #20048.
2013-03-23 09:57:48 +08:00
Aymeric Augustin 89cb771be7 Fixed #19692 -- Completed deprecation of mimetype in favor of content_type.
Thanks Tim for the report and initial patch.
2013-01-31 13:54:40 +01:00
Claude Paroz c91667338a Fixed #19357 -- Allow non-ASCII chars in filesystem paths
Thanks kujiu for the report and Aymeric Augustin for the review.
2012-12-08 11:13:52 +01:00
Claude Paroz 08286ca5d9 Made use of assertXMLEqual in sitemaps tests 2012-10-15 23:05:40 +02:00
Claude Paroz 2ee6a46696 Fixed #15753 -- Cleared cache between sitemaps tests
When caching was activated, test_simple_sitemap would fail
because the test result was fetched from cache.
Thanks lucho for the initial patch and krzysiumed@gmail.com for
the review.
2012-10-15 21:11:32 +02:00
Aymeric Augustin 37c9318748 [py3] Fixed sitemaps tests. 2012-08-14 20:14:31 +02:00
Aymeric Augustin faf570df18 [py3] Compared response.content with bytes. 2012-08-14 12:29:53 +02:00
Aymeric Augustin ee191715ea [py3] Fixed access to dict keys/values/items. 2012-08-07 12:00:22 +02:00
Aymeric Augustin 0d914d08a0 [py3] Updated urllib/urllib2/urlparse imports.
Lots of functions were moved. Use explicit imports in all cases
to keey it easy to identify where the functions come from.
2012-07-22 09:29:55 +02:00
Claude Paroz 2c2c8a6326 Isolated sitemaps test from ABSOLUTE_URL_OVERRIDES
Refs #15988.
2012-06-30 18:50:28 +02:00
Claude Paroz 4a103086d5 Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.
Thanks Vinay Sajip for the support of his django3 branch and
Jannis Leidel for the review.
2012-06-07 18:08:47 +02:00
Claude Paroz 7676d6e764 Made sitemaps tests use override_settings. Refs #14478 2012-06-02 21:24:18 +02:00
Aymeric Augustin eb163f37cb Use the class decorator syntax available in Python >= 2.6. Refs #17965.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17829 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-03-30 09:08:29 +00:00
Jannis Leidel 75a9c8a5ef Fixed #10793 -- Stopped caching paginator instances in sitemap classes to prevent stale sitemaps. Thanks, gnosek, krzysiumed and adam_przybyla.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17468 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-09 18:56:49 +00:00
Adrian Holovaty 6ecadcbdd2 Made a bunch more edits up until [17418]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17428 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-03 20:45:45 +00:00
Aymeric Augustin a4b472dd80 Fixed #8995 -- Added support for HTTPS in sitemaps.
Modularized tests and did a bit of cleanup while I was in the area.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@17409 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-29 19:24:32 +00:00
Aymeric Augustin 123f567093 Fixed #2713 -- Made the name of the sitemap view a parameter of the sitemap index view, in order to allow decorators. Also cleaned up code in the area and removed redundant comments from the tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17408 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-29 09:30:28 +00:00
Adrian Holovaty 8767439af4 Converted some of the built-in views to use content_type instead of mimetype HttpResponse argument. Refs #16519
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17223 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-12-17 03:53:25 +00:00
Aymeric Augustin 06d9b82a27 Fixed #16906 -- Format datetimes with str/unicode instead of strftime where possible: it's faster and it works for all dates.
Also ensured that datetime_safe is used wherever strftime is called on dates/datetimes that may be before 1900.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@16978 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-13 19:23:45 +00:00
Ramiro Morales 26b8122087 Fixed #14675 -- Completed removal of `from django.conf.urls.default import *` usage.
This applies to both our own [test] code and documentation examples. Also:
 * Moved the functions and handlers from `django.conf.urls.defaults` up to
   `django.conf.urls` deprecating the former module.
 * Added documentation for `handler403`.
 * Tweaked the URLs topic document a bit.

Thanks to pupeno and cdestigter for their great work contributing patches.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16818 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-09-11 22:36:16 +00:00
Jannis Leidel 24f4764a48 Fixed #16225 -- Removed unused imports. Many thanks to Aymeric Augustin for the work on the patch and Alex for reviewing.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-13 09:35:51 +00:00
Jannis Leidel 54552ee29f Fixed #16175 -- Modified the sitemaps views to return TemplateResponse instances for easier customization. Thanks, mat.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16476 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-28 10:17:01 +00:00
Jannis Leidel 60f0421ed3 Fixed #12347 -- Added a mimetype option to sitemaps views to further customize the output of the view, e.g. to support Yahoo's plain text urllist format. Thanks, afurlan.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16475 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-28 10:16:47 +00:00
Jannis Leidel 3fe0c69332 Fixed #10907, #14190 and #15829 -- Pass item to sitemaps template to allow further customization like Google News enabled sitemaps. Thanks, manfre and lakinwecker.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16474 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-28 10:16:34 +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
Russell Keith-Magee 7a60b41130 Fixed #15111 -- Ensured that the auth, contenttypes and sitemaps tests will run when the sites app isn't installed. Thanks to Waldemar Kornewald for the report and draft patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15418 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-05 03:49:03 +00:00
Jannis Leidel 8dfd3dfd49 Fixed #14805 -- Capitalize "Google" in sitemaps docs. Thanks, Adam.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14884 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-12 22:56:52 +00:00
Jannis Leidel d0257a1558 Fixed #14041 -- Added ability to override the template of the sitemaps views. Thanks, julien.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14883 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-12 22:56:29 +00:00
Russell Keith-Magee 23a19240da Fixed #14833 -- Skip the sitemaps localization test if i18n isn't enabled. Thanks to Julien Phalip for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14826 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-05 02:07:46 +00:00