Commit Graph

254 Commits

Author SHA1 Message Date
Robert Rollins b6d4b6e544 Fixed #28212 -- Allowed customizing the port that LiveServerTestCase uses.
Forwardport of 877d7b71ae from stable/1.11.x
2017-05-30 18:49:10 -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
Anton Samarchyan 86de930f41 Refs #27656 -- Updated remaining docstring verbs according to PEP 257. 2017-03-04 10:02:06 -05:00
Tim Graham 3f5a35d6e2 Added TransactionTestCase.multi_db instead of using getattr(). 2017-02-13 08:46:00 -05:00
Nadège Michel bece837829 Fixed #20238 -- Added threading support to LiveServerTestCase. 2017-02-09 19:08:32 -05:00
Vytis Banaitis 8838d4dd49 Refs #23919 -- Replaced kwargs.pop() with keyword-only arguments. 2017-02-01 11:41:56 -05:00
chillaranand d6eaf7c018 Refs #23919 -- Replaced super(ClassName, self) with super(). 2017-01-25 12:23:46 -05: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 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 c716fe8782 Refs #23919 -- Removed six.PY2/PY3 usage
Thanks Tim Graham for the review.
2017-01-18 16:21:28 +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
Tim Graham 0f454f5d4d Refs #23960 -- Removed the host parameter for SimpleTestCase.assertRedirects().
Per deprecation timeline.
2017-01-17 14:09:28 -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
Simon Charette 18c72d59e0 Fixed #27214 -- Made skip db features decorators respect wrapping order and inheritance. 2016-09-13 14:12:20 -04:00
Chris Jerdonek f6cd669ff2 Fixed #22414 -- Ensured that LiveServerTestCase closes connections. 2016-08-19 12:47:41 -04:00
Chris Jerdonek 3d0a3c5fff Fixed #27077 -- Made SQLite's in-memory database checks DRYer. 2016-08-17 20:34:18 -04:00
Chris Jerdonek 013ee21cf8 Fixed #26976 -- Added LiveServerTestCase.server_thread_class to ease subclassing. 2016-08-01 16:15:41 -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 81cdcb66bc Fixed #26791 -- Replaced LiveServerTestCase port ranges with binding to port 0. 2016-06-23 12:04:05 -04:00
Tobias McNulty 17e661641d Refs #26666 -- Added ALLOWED_HOSTS validation when running tests.
Also used ALLOWED_HOSTS to check for external hosts in assertRedirects().
2016-06-20 11:07:46 -04:00
Tobias McNulty 78a0ca67f6 Refs #26666 -- Fixed test failures caused by assertRedirects changes (#6701) 2016-06-02 21:47:30 -07:00
Tobias McNulty c7b1b81352 Fixed #26666 -- Added more useful error message to assertRedirects 2016-06-02 14:43:31 -07:00
Tim Graham df8d8d4292 Fixed E128 flake8 warnings in django/. 2016-04-08 09:51:06 -04:00
Tim Graham 2cd2d18851 Fixed W503 flake8 warnings. 2016-04-04 17:14:26 -04:00
Tim Graham d2569f89f2 Fixed #26428 -- Added support for relative path redirects in assertRedirects().
Thanks Trac alias master for the report and review.
2016-04-02 10:35:33 -04:00
Jon Dufresne fcd08c1757 Fixed #11665 -- Made TestCase check deferrable constraints after each test. 2016-02-13 06:53:39 -05:00
knbk e000ca23d2 Removed obsolete comment. 2016-02-08 00:11:22 -05:00
Marten Kenbeek c87540cee5 Fixed #26011 -- Prevented random LiveServerTestCase test failures on Windows.
Prevented LiveServerTestCase from stealing ports used by concurrent
processes on Windows.
2015-12-31 10:57:03 -05:00
Ville Skyttä 3ee18400ae Fixed #25668 -- Misc spelling errors 2015-11-03 11:58:13 +02:00
Tim Graham 0b5d32faca Fixed #25611 -- Standardized descriptor signatures. 2015-10-26 11:31:16 -04:00
Tim Graham 1392aff440 Refs #21977 -- Removed SimpleTestCase.urls per deprecation timeline. 2015-09-23 19:31:09 -04:00
Aymeric Augustin ba81386487 Introduced a mixin for serializing tests. 2015-09-09 23:01:17 +02:00
Aymeric Augustin 326bc0955b Allowed a port range for the liveserver by default.
This is required for running tests in parallel.
2015-09-09 23:01:16 +02:00
Jakub Gocławski a7901c2e09 Refs #25328 -- Refactored LiveServerTestCase to make it extensible. 2015-09-07 08:48:17 -04:00
Maxime Lorant 5153a3bfdc Fixed #25331 -- Removed trailing blank lines in docstrings. 2015-08-31 17:37:21 -04:00
Tommy Beadle d3fdaf907d Fixed #23727 -- Inhibited the post_migrate signal when using serialized_rollback.
When using a TransactionTestCase with serialized_rollback=True,
after creating the database and running its migrations (along with
emitting the post_migrate signal), the contents of the database
are serialized to _test_serialized_contents.

After the first test case, _fixture_teardown() would flush the
tables but then the post_migrate signal would be emitted and new
rows (with new PKs) would be created in the django_content_type
table. Then in any subsequent test cases in a suite,
_fixture_setup() attempts to deserialize the content of
 _test_serialized_contents, but these rows are identical to the
rows already in the database except for their PKs.  This causes an
IntegrityError due to the unique constraint in the
django_content_type table.

This change made it so that in the above scenario the post_migrate
signal is not emitted after flushing the tables, since it will be
repopulated during fixture_setup().
2015-08-24 08:59:20 -04:00
Caio Ariede 62d4074005 Fixed #25191 -- Added string diff to SimpleTestCase.assertXMLEqual() message. 2015-08-04 09:16:34 -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
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
Moritz Sichert d58573e60d Refs #24965 -- Added changes from accidentally reverted file for last commit. 2015-06-12 18:29:26 -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 c2bc1cefdc Refs #23763 -- Silenced SimpleTestCase.assertRaisesMessage() deprecation warning on Python 3.5.
Deprecation warning was introduced in https://bugs.python.org/issue24134
2015-05-16 10:42:12 -04:00
Simon Charette dc27f3ee0c Fixed #19259 -- Added group by selected primary keys support. 2015-03-29 22:03:30 -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