Commit Graph

126 Commits

Author SHA1 Message Date
Tim Graham f892781b95 Fixed #28606 -- Deprecated CachedStaticFilesStorage. 2018-10-27 11:58:29 -04:00
Kamil 3d4080f19c Fixed #29024 -- Made TestContextDecorator call disable() if setUp() raises an exception. 2018-08-17 16:30:27 -04:00
Jan Pieter Waagmeester 24959e48d9 Fixed #27398 -- Added an assertion to compare URLs, ignoring the order of their query strings. 2018-06-20 13:26:12 -04:00
Morgan Aubert 704443acac Fixed #29363 -- Added SimpleTestCase.assertWarnsMessage(). 2018-05-09 11:40:28 -04:00
CHI Cheng 4660ce5a69 Fixed #29375 -- Removed empty action attribute on HTML forms. 2018-05-02 09:20:04 -04:00
Tim Graham cfff2af02b Fixed #27857 -- Dropped support for Python 3.4. 2017-09-25 17:11:03 -04:00
Mads Jensen a51c4de194 Used assertRaisesMessage() to test Django's error messages. 2017-07-29 19:07:23 -04:00
Claude Paroz 43c65e0eb0 Fixed #28180 -- Numbered queries in assertNumQueries failure output
Thanks Tim Graham for the test part.
2017-05-20 15:11:09 +02:00
François Freitag 98b3b14a64 Fixed #28203 -- Ignored connection configuration queries in assertNumQueries(). 2017-05-18 11:48:03 -04:00
Tim Graham 6b4f018b2b Replaced type-specific assertions with assertEqual().
Python docs say, "it's usually not necessary to invoke these methods directly."
2017-03-17 07:51:48 -04:00
Chris Lamb 339d526d55 Fixed #27873 -- Fixed crash in setup_test_environment() if ALLOWED_HOSTS is a tuple.
Regression in 17e661641d
2017-02-24 13:58:56 -05:00
chillaranand d6eaf7c018 Refs #23919 -- Replaced super(ClassName, self) with super(). 2017-01-25 12:23:46 -05:00
Tim Graham 4e729feaa6 Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.
These functions do nothing on Python 3.
2017-01-20 08:01:02 -05:00
Tim Graham 109b33f64c Refs #23919 -- Simplified assertRaisesRegex()'s that accounted for Python 2. 2017-01-20 08:49:47 +01:00
Claude Paroz 2b281cc35e Refs #23919 -- Removed most of remaining six usage
Thanks Tim Graham for the review.
2017-01-18 21:33:28 +01:00
Claude Paroz 7b2f2e74ad Refs #23919 -- Removed six.<various>_types usage
Thanks Tim Graham and Simon Charette for the reviews.
2017-01-18 20:18:46 +01:00
Claude Paroz d7b9aaa366 Refs #23919 -- Removed encoding preambles and future imports 2017-01-18 09:55:19 +01:00
Tim Graham 7510b872e7 Refs #25190 -- Removed callable_obj parameter to assertRaisesMessages().
Per deprecation timeline.
2017-01-17 20:52:01 -05:00
François Freitag f3b7c05936 Refs #16614 -- Made QuerySet.iterator() use server-side cursors on PostgreSQL.
Thanks to Josh Smeaton for the idea of implementing server-side cursors
in PostgreSQL from the iterator method, and Anssi Kääriäinen and Kevin
Turner for their previous work. Also Simon Charette and Tim Graham for
review.
2017-01-11 09:25:37 -05:00
Tim Graham b5f0b3478d Fixed #27579 -- Added aliases for Python 3's assertion names in SimpleTestCase. 2016-12-07 17:42:31 -05:00
za 321e94fa41 Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings. 2016-11-10 21:30:21 -05:00
Simon Charette 18c72d59e0 Fixed #27214 -- Made skip db features decorators respect wrapping order and inheritance. 2016-09-13 14:12:20 -04:00
Adam Zapletal ca2ccf54ff Fixed #24112 -- Fixed assertInHTML()'s counting if needle has no root element. 2016-08-31 20:41:34 -04:00
Chris Jerdonek e7fb724cd2 Fixed #27032 -- Prevented setup_test_environment() from being called twice. 2016-08-08 10:40:29 -04:00
Dmitry Dygalo d7a097265b Fixed #26922 -- Fixed SimpleTestCase.assertHTMLEqual() crash on Python 3.5+. 2016-07-21 14:01:23 -04:00
Tim Graham 92053acbb9 Fixed E128 flake8 warnings in tests/. 2016-04-08 10:12:33 -04:00
Hasan 253adc2b8a Refs #26022 -- Used context manager version of assertRaisesMessage in tests. 2016-01-29 13:03:39 -05:00
Hasan 3d0dcd7f5a Refs #26022 -- Used context manager version of assertRaises in tests. 2016-01-29 12:32:18 -05:00
Simon Charette 7bb373e309 Refs #25746 -- Added a test utility to isolate inlined model registration.
Thanks to Tim for the review.
2016-01-06 20:00:07 -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
Mattia Larentis 2085d8d5bc Fixed #25170 -- Made assertXMLEqual()/assertXMLNotEqual() ignore leading and trailing whitespace.
Thanks Jacek Bzdak for indepdently contributing a similar fix.
2015-11-09 15:53:30 -05:00
Dražen Odobašić b1e33ceced Fixed #23395 -- Limited line lengths to 119 characters. 2015-09-12 11:40:50 -04:00
Caio Ariede 62d4074005 Fixed #25191 -- Added string diff to SimpleTestCase.assertXMLEqual() message. 2015-08-04 09:16:34 -04:00
Tim Graham fd81588bc6 Refs #25176 -- Fixed typo in tests/test_utils/tests.py 2015-08-01 07:39:16 -04:00
Adam Chainz 0abb06930f Fixed #25176 -- Prevented TestCase.setUpTestData() exception from leaking transaction. 2015-08-01 07:33:22 -04:00
Tim Graham 1c7c782d6e Fixed #25188 -- Improved message raised by SimpleTestCase.assertRaisesMessage().
Thanks Chris Jerdonek for the suggestion and help with the patch.
2015-07-31 09:19:27 -04:00
Tim Graham d27e0f04a6 Fixed #25190 -- Deprecated callable_obj parameter to assertRaisesMessage().
Thanks Aymeric Augustin for review.
2015-07-30 10:12:41 -04:00
Simon Charette be67400b47 Refs #24652 -- Used SimpleTestCase where appropriate. 2015-05-20 13:46:13 -04:00
Simon Charette c15b0c2792 Fixed #24652 -- Disallowed query execution in SimpleTestCase subclasses.
Thanks to Tim and Anssi for the review.
2015-05-20 12:50:41 -04:00
Tim Graham e89c3a4603 Added backwards compatibility for assertRaisesMessage callable_obj param.
This was broken in c2bc1cefdc (refs #23763).
2015-05-18 10:04:18 -04:00
Tim Graham 0ed7d15563 Sorted imports with isort; refs #23860. 2015-02-06 08:16:28 -05:00
mlavin 2730dad0d7 Fixed #24197 -- Added clearing of staticfiles caches on settings changes during tests
Cleared caching in staticfiles_storage and get_finder when
relevant settings are changed.
2015-02-04 10:53:04 -05:00
Tim Graham c5c235cd4f Fixed typo in test_utils comment. 2014-12-24 07:10:34 -05:00
wrwrwr e6f19ec322 Fixed #23933 -- Made override_settings(DATABASE_ROUTERS) affect the master router. 2014-12-01 11:30:50 -05:00
Davide Ceretti 2d06e3155a Fixed #23300 -- Made assertTemplateUsed throw an error on responses not fetched using the test client.
Thanks zags for the report and bmispelon for the patch.
2014-11-03 14:31:23 -05:00
Berker Peksag f7969b0920 Fixed #23620 -- Used more specific assertions in the Django test suite. 2014-11-03 11:56:37 -05:00
Duncan Parkes 88b6cf4ae4 Fixed #23600 -- Made default_storage aware of more settings changes.
Added MEDIA_URL, FILE_UPLOAD_PERMISSIONS, and
FILE_UPLOAD_DIRECTORY_PERMISSIONS to the list of settings.
2014-10-08 18:10:47 -04:00
Thomas Chaumeny 311b3ad9db Fixed #23567 -- Made assertQuerysetEqual check Counter equality when ordered=False 2014-09-29 12:00:14 -04:00
Claude Paroz 5675eb371f Allowed skipIf/UnlessDBFeature to accept several feature strings 2014-08-26 20:03:37 +02:00
Loic Bistuer 942556df2f Fixed #22572 -- override_settings(ROOT_URLCONF) didn't clear urlresolvers._urlconfs.
Thanks Anubhav Joshi and Tim Graham for the reviews.
2014-05-05 19:29:27 +07:00
amatellanes 8394e570ba Fixed #22465 -- New assertion assertJSONNotEqual 2014-04-18 15:11:08 +07:00
Anubhav Joshi cd914e31c9 Fixed #21977 -- Deprecated SimpleTestCase.urls 2014-04-06 17:33:43 -04:00
Tim Graham d73d0e071c Fixed #22218 -- Deprecated django.conf.urls.patterns.
Thanks Carl Meyer for the suggestion and Alex Gaynor and Carl for reviews.
2014-04-03 07:28:10 -04:00
Tim Graham bf5430a20b Removed django.test.simple and django.test._doctest per deprecation timeline.
refs #17365, #17366, #18727.
2014-03-21 13:36:46 -04:00
Chris Wilson 65131911db Fixed #21518 -- Made override_settings(ROOT_URLCONF) clear the resolver cache.
Thanks Aymeric Augustin and Simon Charette for reviews.
2014-02-07 15:29:25 -05:00
Dominic Rodger 5cd6477fd6 Fixed #21462 -- Made `assertNumQueries` print executed queries on failure. 2013-12-11 15:24:17 -05:00
Loic Bistuer a2814846ca Fixed E124 pep8 warnings. 2013-12-10 15:12:48 -05:00
Unai Zalakain 72f63bd24d Fixed #17529 -- get_template_from_string default arguments break
``get_template_from_string`` default arguments were breaking
``assertTemplateUsed``. The solution has been to return only the names of the
templates with a ``name`` attribute distinct of ``None``. The default ``name``
kwarg of ``Template`` has been changed to ``None``, more pythonic than ``'<Unknown
Template>'``.
2013-11-08 17:10:37 +01:00
Alex Gaynor b35ff0d920 Fixed all the E203 violations 2013-10-26 18:27:42 -07:00
Alasdair Nicol dfb4cb9970 Fixed #21285 -- Fixed E121,E122 pep8 warnings 2013-10-17 20:20:11 -04:00
Tim Graham ff9e8eccf8 Removed unnecessary semicolons. 2013-10-10 08:50:32 -04:00
Aymeric Augustin ee0ef1b094 Partial revert of 165f44aa.
That commit didn't always improve readability.

See discussion on django-developers for details.
2013-09-22 14:04:10 +02:00
Claude Paroz 165f44aaaa Combine consecutive with statements
Python 2.7 allows to combine several 'with' instructions.
2013-08-16 20:12:10 +02:00
Claude Paroz 5c1143910e Removed most of absolute_import imports
Should be unneeded with Python 2.7 and up.
Added some unicode_literals along the way.
2013-07-29 20:28:13 +02:00
Claude Paroz 6d52844b9b Fixed #18551 -- Enabled skipIfDBFeature/skipUnlessDBFeature to decorate a class
Thanks Tim Graham for the review and improved patch.
2013-07-19 20:30:14 +02:00
Aymeric Augustin 909433fa50 Removed tests for django.utils.unittest vs. unittest.
Silenced warnings caused by the deprecation of django.utils.unittest.

Thanks Preston Timmons and Carl Meyer for their advice.

Fixed #20680.
2013-07-01 21:49:11 +02:00
Aymeric Augustin cfcf4b3605 Stopped using django.utils.unittest in the test suite.
Refs #20680.
2013-07-01 14:29:33 +02:00
Aymeric Augustin acd7b34aaf Advanced deprecation warnings for Django 1.7. 2013-06-29 18:49:37 +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 4f6be9a0c4 Removed warnings level handling code as per deprecation TL. 2013-06-28 21:48:15 -03:00
Marc Tamlyn 46789e76c6 Fixed #20548 -- Removed all PendingDeprecationWarnings from django test suite 2013-06-14 15:37:39 +01:00
Claude Paroz f56b703b27 Used a Python 3 compatible StringIO in test_utils 2013-04-13 11:38:13 +02:00
Preston Timmons 751b007c98 Modified test_utils to work with unittest2 discovery. 2013-04-12 15:00:48 -06:00
Simon Charette 952ba5237e Added a context manager to capture queries while testing.
Also made some import cleanups while I was there.

Refs #10399.
2013-03-02 02:41:14 -05:00
Florian Apolloner 33836cf88d Renamed some tests and removed references to modeltests/regressiontests. 2013-02-26 14:36:57 +01:00
Florian Apolloner 89f40e3624 Merged regressiontests and modeltests into the test root. 2013-02-26 14:36:57 +01:00