Commit Graph

93 Commits

Author SHA1 Message Date
Vincent Poulailleau fcd431c6c3 Improved generic detail view error message for when pk or slug is missing. 2018-01-17 10:58:05 -05:00
Bjorn Kristinsson ac6a4eb9f9 Fixed #28719 -- Added a helpful exception if MultipleObjectTemplateResponseMixin doesn't generate any template names. 2017-11-07 18:46:52 -05:00
Sjoerd Job Postmus df41b5a05d Fixed #28593 -- Added a simplified URL routing syntax per DEP 0201.
Thanks Aymeric Augustin for shepherding the DEP and patch review.
Thanks Marten Kenbeek and Tim Graham for contributing to the code.
Thanks Tom Christie, Shai Berger, and Tim Graham for the docs.
2017-09-20 18:04:42 -04:00
Sebastian Sassi 5848305218 Fixed #28082 -- Made BaseDateListView pass context from get_dated_items() to subclasses.
Thanks leon-matthews for the report and fix.
2017-09-04 10:55:18 -04:00
Mads Jensen a51c4de194 Used assertRaisesMessage() to test Django's error messages. 2017-07-29 19:07:23 -04:00
Bruno Alla 604341c85f Fixed #28331 -- Added ContextMixin.extra_context to allowing passing context in as_view(). 2017-07-06 10:34:54 -04:00
Jon Dufresne 2c69824e5a Refs #23968 -- Removed unnecessary lists, generators, and tuple calls. 2017-06-01 19:08:59 -04:00
Adit Biswas c2eea61dff Fixed #28209 -- Made date-based generic views return a 404 rather than crash when given an out of range date. 2017-05-30 13:20:35 -04:00
Florian Apolloner d611a89238 Decreased max_length for char fields unless absolutely needed. (#8485) 2017-05-10 17:33:46 +02:00
Grzegorz Tężycki fede65260a Fixed #26911 -- Removed NoReverseMatch silencing in RedirectView. 2017-03-01 15:56:39 -05:00
chillaranand d6eaf7c018 Refs #23919 -- Replaced super(ClassName, self) with super(). 2017-01-25 12:23:46 -05:00
Claude Paroz dc8834cad4 Refs #23919 -- Removed unneeded force_str calls 2017-01-20 08:44:31 +01:00
Simon Charette cecc079168 Refs #23919 -- Stopped inheriting from object to define new style classes. 2017-01-19 08:39:46 +01:00
Claude Paroz f3c43ad1fd Refs #23919 -- Removed python_2_unicode_compatible decorator usage 2017-01-18 13:44:34 +01:00
Claude Paroz d7b9aaa366 Refs #23919 -- Removed encoding preambles and future imports 2017-01-18 09:55:19 +01:00
Tim Graham e744c7e459 Imported specific models in a few tests that didn't. 2016-12-08 11:14:15 -05:00
Ramin Farajpour Cami 967be82443 Fixed E305 flake8 warnings. 2016-11-14 12:30:46 -05:00
za 321e94fa41 Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings. 2016-11-10 21:30:21 -05:00
Tim Graham c9ae09addf Replaced use of TestCase.fail() with assertRaises().
Also removed try/except/fail antipattern that hides exceptions.
2016-06-28 11:21:26 -04:00
Claude Paroz 78963495d0 Refs #17209 -- Added LoginView and LogoutView class-based views
Thanks Tim Graham for the review.
2016-06-24 10:45:13 +02:00
Jon Dufresne 4f336f6652 Fixed #26747 -- Used more specific assertions in the Django test suite. 2016-06-16 14:19:18 -04:00
Tim Graham 92053acbb9 Fixed E128 flake8 warnings in tests/. 2016-04-08 10:12:33 -04:00
Hasan 3d0dcd7f5a Refs #26022 -- Used context manager version of assertRaises in tests. 2016-01-29 12:32:18 -05:00
Marten Kenbeek 16411b8400 Fixed #26013 -- Moved django.core.urlresolvers to django.urls.
Thanks to Tim Graham for the review.
2015-12-31 14:21:29 -05:00
Chris Cogdon e429c5186c Fixed #26018 -- Prevented unecessary get_form() call in FormMixin.get_context_data().
Changed "dict.setdefault" to "if x in dict" pattern so that get_form() would not
be called unnecessarily, specifically in the case where FormMixin.form_invalid()
calls get_context_data() with the current form.
2015-12-30 17:29:39 -05:00
Chris Cogdon 4b2dcfe04f Fixed #26006 -- Fixed incorrect object reference in SingleObjectMixin.get_context_object_name(). 2015-12-30 09:56:45 -05:00
Alex Morozov 13dba4dba3 Fixed #25780 -- Removed redundant status code assertions from tests 2015-11-21 18:12:33 +01:00
Alex Morozov e171a83b15 Fixed #25548 -- Prevented FormView.form_invalid() from discarding its form argument. 2015-11-11 13:28:34 -05:00
lobziik 7a48f9abf2 Renamed a test file that has no tests. 2015-11-07 21:28:13 +01:00
Tim Graham 491de4f07c Refs #23656 -- Required FormMixin.get_form() form_class parameter to be optional.
Per deprecation timeline.
2015-09-23 19:31:10 -04:00
Tim Graham 6eed9ae747 Refs #24133 -- Removed legacy formatting syntax in success_url placeholders.
Per deprecation timeline.
2015-09-23 19:31:10 -04:00
Dražen Odobašić b1e33ceced Fixed #23395 -- Limited line lengths to 119 characters. 2015-09-12 11:40:50 -04:00
Tim Graham aaacaeb096 Renamed RemovedInDjangoXYWarnings for new roadmap.
Forwardport of ae1d663b79
from stable/1.8.x plus more.
2015-06-24 16:08:20 -04:00
Simon Charette be67400b47 Refs #24652 -- Used SimpleTestCase where appropriate. 2015-05-20 13:46:13 -04:00
Alasdair Nicol eaeea6f947 Fixed #24714 -- Used more specific assertions than assertEqual in tests. 2015-04-28 09:31:04 -04:00
Artis Avotins 86aaffa5a3 Fixed #24689 -- Fixed DetailView methods with deferred QuerySet. 2015-04-25 19:42:00 -04:00
Andrei Kulakov 8a1824d465 Fixed #24643 -- Added get_context_data() method to FormMixin 2015-04-24 20:17:29 -04:00
Claude Paroz a0c2eb46dd Fixed #23960 -- Removed http.fix_location_header
Thanks Carl Meyer for the report and Tim Graham for the review.
2015-03-18 18:22:50 +01:00
Josh Smeaton 39a7eed1bb Converted test fixtures to setUpTestData methods 2015-03-05 10:10:32 +11:00
Tim Graham 0ed7d15563 Sorted imports with isort; refs #23860. 2015-02-06 08:16:28 -05:00
Tim Graham 118b11221f Fixed #24263 -- Prevented extra queries on BaseDateDetailView with a custom queryset.
Thanks jekka-ua for the report and patch.
2015-02-03 09:12:37 -05:00
Aymeric Augustin 2133f3157e Fixed #24168 -- Allowed selecting a template engine in a few APIs.
Specifically in rendering shortcuts, template responses, and class-based
views that return template responses.

Also added a test for render_to_response(status=...) which was missing
from fdbfc980.

Thanks Tim and Carl for the review.
2015-02-03 08:29:45 +01:00
Tomáš Ehrlich 511be35779 Fixed #24220 - Allowed lazy objects for success_url 2015-01-26 17:58:55 +01:00
Tim Graham 6e13c0490d Changed RedirectView.permanent to False per deprecation timeline; refs #21587. 2015-01-18 17:43:06 -05:00
Collin Anderson a420f83e7d Fixed #24055 -- Keep reference to view class for resolve() 2015-01-17 22:09:10 +07:00
Claude Paroz f48e2258a9 Fixed #24133 -- Replaced formatting syntax in success_url placeholders
Thanks Laurent Payot for the report, and Markus Holtermann, Tim Graham
for the reviews.
2015-01-12 22:51:22 +01:00
Claude Paroz 51890ce889 Applied ignore_warnings to Django tests 2014-12-30 18:16:25 +01:00
Tim Graham df9f2e41fa Refs #23943 -- Removed an invalid generic_views test.
Using PUT as a method for the form element is no longer supported
as described in the ticket.
2014-12-12 16:14:10 -05:00
Tim Graham 3131e9cef5 Fixed #23923 -- Promoted Django's deprecation warnings to errors in runtests.py 2014-11-29 10:27:04 -05:00
Berker Peksag 9a30acad8a Fixed #21587 -- Added a warning for changing default of RedirectView.permanent. 2014-11-25 09:22:18 -05:00