summaryrefslogtreecommitdiff
path: root/tests/test_utils/tests.py
AgeCommit message (Collapse)Author
2022-02-08[4.0.x] Refs #33476 -- Refactored code to strictly match 88 characters line ↵Mariusz Felisiak
length. Backport of 7119f40c9881666b6f9b5cf7df09ee1d21cc8344 from main.
2022-02-08[4.0.x] Refs #33476 -- Reformatted code with Black.django-bot
Backport of 9c19aff7c7561e3a82978a272ecdaad40dda5c00 from main.
2022-02-03[4.0.x] Refs #33476 -- Refactored problematic code before reformatting by Black.Mariusz Felisiak
In these cases Black produces unexpected results, e.g. def make_random_password( self, length=10, allowed_chars='abcdefghjkmnpqrstuvwxyz' 'ABCDEFGHJKLMNPQRSTUVWXYZ' '23456789', ): or cursor.execute(""" SELECT ... """, [table name], ) Backport of c5cd8783825b5f6384417dac5f3889b4210b7d08 from main.
2022-01-07[4.0.x] Fixed #33410 -- Fixed recursive capturing of callbacks by ↵Petter Friberg
TestCase.captureOnCommitCallbacks(). Regression in d89f976bddb49fb168334960acc8979c3de991fa. Backport of bc174e6ea0ce676c5a7f467bda9739e6ef6b6186 from main
2021-12-08[4.0.x] Fixed #33346 -- Fixed SimpleTestCase.assertFormsetError() crash on a ↵Baptiste Mispelon
formset named "form". Thanks OutOfFocus4 for the report. Regression in 456466d932830b096d39806e291fe23ec5ed38d5. Backport of cb383753c0e0eb52306e1024d32a782549c27e61 from main.
2021-08-30Fixed #33054 -- Made TestCase.captureOnCommitCallbacks() capture callbacks ↵Eugene Morozov
recursively.
2021-03-19Fixed #32556 -- Fixed handling empty string as non-boolean attributes value ↵Baptiste Mispelon
by assertHTMLEqual().
2021-03-18Fixed #32556 -- Fixed assertHTMLEqual() to handle empty string as boolean ↵Hasan Ramezani
attributes value.
2021-03-02Refs #21429 -- Added SimpleTestCase.assertNoLogs() on Python < 3.10.François Freitag
2021-02-26Fixed typo in assertQuerysetEqual() exception message.Jacob Walls
2021-02-22Fixed #32469 -- Made assertQuerysetEqual() respect maxDiff when ordered=False.Nick Pope
2020-11-06Fixed #31235 -- Made assertQuerysetEqual() compare querysets directly.Hasan Ramezani
This also replaces assertQuerysetEqual() to assertSequenceEqual()/assertCountEqual() where appropriate. Co-authored-by: Peter Inglesby <peter.inglesby@gmail.com> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2020-09-24Fixed #27906 -- Fixed test tools counting of HTML matches for subsets of ↵Jacob Walls
elements. Previously examples such as '<a/><b/>' would not match in '<a/><b/><c/>'.
2020-09-07Fixed #31944 -- Used addCleanup() to register TestContextDecorator cleanups.François Freitag
Cleanups from addCleanup() are scheduled to happen in reverse order to the order they are added (LIFO). Ensures each cleanup is executed from the innermost to the outermost.
2020-07-13Fixed #30457 -- Added TestCase.captureOnCommitCallbacks().Adam Johnson
2020-04-20Capitalized Unicode in docs, strings, and comments.Jon Dufresne
2020-02-13Fixed #31250 -- Ignored processing instructions in ↵yura
assertXMLEqual()/assertXMLNotEqual().
2020-02-07Used assertRaisesMessage() in various tests.Hasan Ramezani
2020-02-06Fixed #31233 -- Closed database connections and cursors after use.Jon Dufresne
2019-05-24Fixed #30497 -- Ignored document type in assertXMLEqual()/assertXMLNotEqual().Caio Ariede
2019-05-10Fixed #30470 -- Added assertHTMLEqual() support for all self closing tags.Jon Dufresne
Support for the following tags was added: area, embed, param, track, and wbr. The full list of self closing tags is documented at: https://html.spec.whatwg.org/#void-elements
2019-05-09Fixed #30468 -- Fixed assertHTMLEqual() to handle all ASCII whitespace in a ↵Jon Dufresne
class attribute.
2019-05-09Refs #27804 -- Used subTest() in HTMLEqualTests.test_self_closing_tags. Jon Dufresne
2019-05-09Refs #30399 -- Made assertHTMLEqual normalize character and entity references.Jon Dufresne
2019-04-29Refs #26022 -- Used context manager version of assertRaisesMessage in tests.Jon Dufresne
Follow up to 253adc2b8a52982139d40c4f55b3fd446e1cb8f3.
2019-02-08Fixed #30004 -- Changed default FILE_UPLOAD_PERMISSION to 0o644.Himanshu Lakhara
2019-01-21Fixed #30121 -- Fixed assertURLEqual() crash with reverse_lazy() URLs.Jon Dufresne
Regression in 24959e48d949a20be969f649ece3576dbc7ce422.
2019-01-14Refs #28478 -- Prevented database feature based skipping on tests ↵Simon Charette
disallowing queries. Database features may require a connection to be established to determine whether or not they are enabled.
2019-01-14Refs #28478 -- Prevented connection attempts against disallowed databases in ↵Simon Charette
tests. Mocking connect as well as cursor methods makes sure an appropriate error message is surfaced when running a subset of test attempting to access a a disallowed database.
2019-01-10Refs #28478 -- Deprecated TestCase's allow_database_queries and multi_db in ↵Simon Charette
favor of databases.
2018-12-31Updated test URL patterns to use path() and re_path().Tim Graham
2018-11-27Switched setUp() to setUpTestData() where possible in Django's tests.Simon Charette
2018-10-27Fixed #28606 -- Deprecated CachedStaticFilesStorage.Tim Graham
2018-08-17Fixed #29024 -- Made TestContextDecorator call disable() if setUp() raises ↵Kamil
an exception.
2018-06-20Fixed #27398 -- Added an assertion to compare URLs, ignoring the order of ↵Jan Pieter Waagmeester
their query strings.
2018-05-09Fixed #29363 -- Added SimpleTestCase.assertWarnsMessage().Morgan Aubert
2018-05-02Fixed #29375 -- Removed empty action attribute on HTML forms.CHI Cheng
2017-09-25Fixed #27857 -- Dropped support for Python 3.4.Tim Graham
2017-07-29Used assertRaisesMessage() to test Django's error messages.Mads Jensen
2017-05-20Fixed #28180 -- Numbered queries in assertNumQueries failure outputClaude Paroz
Thanks Tim Graham for the test part.
2017-05-18Fixed #28203 -- Ignored connection configuration queries in assertNumQueries().François Freitag
2017-03-17Replaced type-specific assertions with assertEqual().Tim Graham
Python docs say, "it's usually not necessary to invoke these methods directly."
2017-02-24Fixed #27873 -- Fixed crash in setup_test_environment() if ALLOWED_HOSTS is ↵Chris Lamb
a tuple. Regression in 17e661641ddaf8266e7430d83cfb2039abc55df7
2017-01-25Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand
2017-01-20Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.Tim Graham
These functions do nothing on Python 3.
2017-01-20Refs #23919 -- Simplified assertRaisesRegex()'s that accounted for Python 2.Tim Graham
2017-01-18Refs #23919 -- Removed most of remaining six usageClaude Paroz
Thanks Tim Graham for the review.
2017-01-18Refs #23919 -- Removed six.<various>_types usageClaude Paroz
Thanks Tim Graham and Simon Charette for the reviews.
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2017-01-17Refs #25190 -- Removed callable_obj parameter to assertRaisesMessages().Tim Graham
Per deprecation timeline.