summaryrefslogtreecommitdiff
path: root/django/test
AgeCommit message (Collapse)Author
2025-02-16[5.2.x] Fixed #35967 -- Deferred test suite fixtures serialization after all ↵Simon Charette
dbs setup. While the top-level objects fed to serialization are bound to the test database being created nothing prevents code invoked during serialization from performing queries against other connections entries that haven't been swapped yet. The reported example of that is a database router directing all reads to a test mirror for a set of models involving auto-created many-to-many fields. It might be tempting to address the many-to-many field case but this a symptom of a larger problem where the test framework yields the flow execution to user code that could interact with non-test databases in unexpected ways. Deferring test database fixture serialization until the point where all connections entries have been swapped for their test equivalent ensures that no code triggered during serialization can interact with non-test databases. Thanks Jake Howard for the report and Jacob Walls for the initial investigation. Backport of dc69a63f844b2ef3bc3371edde91644cf0bef0ee from main
2025-01-04Fixed #36057 -- Enabled test runner to debug chained exceptions with `--pdb` ↵Adam Johnson
on Python 3.13+.
2025-01-03Fixed #35414 -- Used default headers in AsyncRequestFactory.YashRaj1506
2024-11-06Fixed #35849 -- Made ParallelTestSuite report correct error location.David Winiecki
2024-11-06Refs #35849 -- Added a handle_event hook to ParallelTestSuite.David Winiecki
2024-10-16Refs #35727 -- Updated response.content.decode calls to use the ↵SaJH
HttpResponse.text property. Signed-off-by: SaJH <wogur981208@gmail.com>
2024-09-17Fixed #35660 -- Made serialized_rollback and fixture data available in ↵Jacob Walls
TransactionTestCase.setUpClass().
2024-09-17Refs #35660 -- Updated TransactionTestCase methods into class or static methods.Jacob Walls
2024-08-08Fixed #35622 -- Made unittest ignore Django assertions in traceback frames.Adam Johnson
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2024-07-22Fixed typo in django/test/testcases.py docstring.Jacob Walls
2024-05-29Fixed 35467 -- Replaced urlparse with urlsplit where appropriate.Jake Howard
This work should not generate any change of functionality, and `urlsplit` is approximately 6x faster. Most use cases of `urlparse` didn't touch the path, so they can be converted to `urlsplit` without any issue. Most of those which do use `.path`, simply parse the URL, mutate the querystring, then put them back together, which is also fine (so long as urlunsplit is used).
2024-05-13Fixed SeleniumTestCase.set_emulated_media() when using selenium_hub.Nick Pope
The .execute_cdp_cmd() method doesn't exist on selenium.webdriver.Remote.
2024-05-13Added support for using Microsoft Edge with Selenium.Nick Pope
2024-05-10Organized images in the screenshots workflow.Nick Pope
Added a top-level directory in the zip archive that is the commit hash which makes it easier when downloading multiple artifacts for comparison. Updated the filenames of screenshots for easier comparison between different cases. Added that an error is raised if no screenshots uploaded in workflow.
2024-05-03Refs #31224 -- Fixed typo in django/test/client.py.Natalia
2024-05-02Added a high contrast mode to screenshot cases.Sarah Boyce
Thank you to Sarah Abderemane and Nick Pope for the reviews.
2024-03-13Fixed #34901 -- Added async-compatible interface to session engines.Jon Janzen
Thanks Andrew-Chen-Wang for the initial implementation which was posted to the Django forum thread about asyncifying contrib modules.
2024-03-09Moved --failfast to DiscoverRunner.Adam Johnson
2024-02-26Refs #32114 -- Fixed test crash on non-picklable objects in subtests when ↵David Wobrock
PickleError is raised. Related to the https://github.com/python/cpython/issues/73373. Follow up to c09e8f5fd8f977bf16e9ec5d11b370151fc81ea8.
2024-02-21Fixed #32114 -- Fixed parallel test crash on non-picklable objects in subtests.David Wobrock
2024-02-19Fixed #35226 -- Reallowed executing queries for dynamically created connections.Mariusz Felisiak
Regression in 8fb0be3500cc7519a56985b1b6f415d75ac6fedb. Thanks Florian Apolloner for the report.
2024-02-14Fixed #28263 -- Fixed TestCase setup for databases that don't support ↵Tim Graham
savepoints.
2024-01-26Applied Black's 2024 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/24.1.0
2024-01-04Used enterClassContext() where appropriate.Mariusz Felisiak
2024-01-03Fixed #33277 -- Disallowed database connections in threads in SimpleTestCase.David Wobrock
2023-12-22Fixed #34658 -- Added SimpleTestCase.assertNotInHTML().Nicolas Lupien
2023-12-12Refs #34305 -- Added SimpleTestCase.enterClassContext() on Python < 3.11.Nick Pope
2023-12-06Refs #34986 -- Moved garbage_collect() helper to django.test.utils.Nick Pope
2023-11-24Fixed #34983 -- Deprecated django.utils.itercompat.is_iterable().Nick Pope
2023-11-23Fixed #14611 -- Added query_params argument to RequestFactory and Client ↵Tom Carrick
classes.
2023-10-31Fixed #32106 -- Preserved HTTP_HOST in test Client when following redirects.Ben Cail
Co-authored-by: David Sanders <shang.xiao.sanders@gmail.com>
2023-10-23Fixed #34903, Refs #34825 -- Made workers initialization respect empty set ↵David Sanders
of used connections. Thanks to David Smith for the investigation & patch. Regression in 2128a73713735fb794ca6565fd5d7792293f5cfa. Follow up to a5905b164dbf52e59fa646af9c3d523c0804d86a. Co-authored-by: David Sanders <shang.xiao.sanders@gmail.com>
2023-10-18Refs #34043 -- Added --screenshots option to runtests.py and selenium tests.Sarah Boyce
2023-10-16Refs #34043 -- Added context managers to SeleniumTestCase for changing ↵Sarah Boyce
window size.
2023-10-03Fixed #34657 -- Made assert(Not)Contains/assertInHTML display haystacks in ↵Chinmoy Chakraborty
error messages.
2023-10-03Refs #34657 -- Made msg_prefix handling in assertURLEqual()/assertInHTML ↵Mariusz Felisiak
consistent with other assertions. Co-authored-by: Chinmoy Chakraborty <chinmoy12c@gmail.com>
2023-10-02Fixed #32602 -- Clarified wording of TestCase class.faishalmanzar
2023-09-29Refs #34657 -- Made assertInHTML() use unparsed needle in error messages.Chinmoy Chakraborty
2023-09-29Refs #15667 -- Added resetting default renderer when FORM_RENDERER is changed.Mariusz Felisiak
2023-09-25Fixed #34825 -- Avoided setting unused connections when initializing ↵David Sanders
parallel workers.
2023-09-22Fixed #34823 -- Fixed assertTemplateUsed() context manager crash on unnamed ↵Arian
templates.
2023-09-18Refs #26029 -- Removed DEFAULT_FILE_STORAGE and STATICFILES_STORAGE settings.Mariusz Felisiak
This also removes django.core.files.storage.get_storage_class(). Per deprecation timeline.
2023-09-18Refs #33990 -- Removed TransactionTestCase.assertQuerysetEqual() per ↵Mariusz Felisiak
deprecation timeline.
2023-09-18Refs #33990 -- Removed SimpleTestCase.assertFormsetError() per deprecation ↵Mariusz Felisiak
timeline.
2023-08-31Fixed #34210 -- Added unittest's durations option to the test runner.David Smith
2023-08-30Fixed #34757 -- Added support for following redirects to AsyncClient.Olivier Tabone
2023-08-24Corrected AsyncRequestFactory's docstring.Mariusz Felisiak
All AsyncRequestFactory methods are still synchronous callables.
2023-08-23Refs #34757 -- Moved HTTP redirect logic to django.test.client.ClientMixin.Olivier Tabone
2023-07-27Simplified call_command() calls.Nick Pope
2023-07-27Fixed typo in django/test/utils.py.Bruno Alla