summaryrefslogtreecommitdiff
path: root/tests/test_utils
Commit message (Collapse)AuthorAgeFilesLines
* Refs #33476 -- Applied Black's 2023 stable style.David Smith2023-02-011-1/+1
| | | | | | | | Black 23.1.0 is released which, as the first release of the year, introduces the 2023 stable style. This incorporates most of last year's preview style. https://github.com/psf/black/releases/tag/23.1.0
* Fixed #34233 -- Dropped support for Python 3.8 and 3.9.Mariusz Felisiak2023-01-181-43/+0
|
* Refs #33348 -- Removed support for passing response object and form/formset ↵Mariusz Felisiak2023-01-171-247/+1
| | | | | | name to SimpleTestCase.assertFormError()/assertFormSetError(). Per deprecation timeline.
* Refs #33348 -- Removed support for passing errors=None to ↵Mariusz Felisiak2023-01-171-34/+0
| | | | | | SimpleTestCase.assertFormError()/assertFormsetErrors(). Per deprecation timeline.
* Refs #26029 -- Deprecated DEFAULT_FILE_STORAGE and STATICFILES_STORAGE settings.Jarosław Wygoda2023-01-121-3/+5
|
* Used DatabaseFeatures.django_test_skips to skip ↵Christophe Baldy2022-11-241-4/+0
| | | | AssertNumQueriesUponConnectionTests tests.
* Refs #33990 -- Renamed TransactionTestCase.assertQuerysetEqual() to ↵Gregor Gärtner2022-10-081-15/+24
| | | | | | assertQuerySetEqual(). Co-Authored-By: Michael Howitz <mh@gocept.com>
* Refs #33990 -- Renamed SimpleTestCase.assertFormsetError() to ↵Gregor Gärtner2022-10-071-40/+49
| | | | | | assertFormSetError(). Co-Authored-By: Michael Howitz <mh@gocept.com>
* Fixed #33616 -- Allowed registering callbacks that can fail in ↵SirAbhi132022-09-061-0/+26
| | | | | | transaction.on_commit(). Thanks David Wobrock and Mariusz Felisiak for reviews.
* Fixed #33633 -- Skipped some test_utils tests on databases that don't ↵zhangyangyu2022-04-122-0/+7
| | | | support transactions.
* Refs #33173 -- Fixed test_runner/test_utils tests on Python 3.11+.Mariusz Felisiak2022-04-071-4/+9
| | | | Python 3.11 uses fully qualified test name in unittest output. See https://github.com/python/cpython/commit/755be9b1505af591b9f2ee424a6525b6c2b65ce9
* Fixed #33348 -- Changed ↵Baptiste Mispelon2022-04-061-148/+296
| | | | | | | SimpleTestCase.assertFormError()/assertFormsetErrors() to take form/formset. Instead of taking a response object and a context name for the form/formset, the two methods now take the object directly.
* Moved remaining SimpleTestCase.assertFormError()/assertFormsetErrors() tests ↵Mariusz Felisiak2022-04-051-0/+135
| | | | | | | to test_utils. This also removes redundant tests in test_client_regress. Follow up to 68144f40490b2572c8da4341742b9e387e3f6bdd.
* Rewrote some references to "master".Adam Johnson2022-03-081-1/+1
| | | | Following d9a266d657f66b8c4fa068408002a4e3709ee669.
* Removed redundant QuerySet.all() calls in docs and tests.Nick Pope2022-02-221-7/+7
| | | | Most QuerySet methods are mapped onto the Manager and, in general, it isn't necessary to call .all() on the manager.
* Refs #33348 -- Made SimpleTestCase.assertFormError() raise ValueError when ↵Baptiste Mispelon2022-02-151-0/+11
| | | | "field" is passed without "form_index".
* Refs #33348 -- Fixed SimpleTestCase.assertFormError() error message raised ↵Mariusz Felisiak2022-02-151-0/+3
| | | | for unbound forms.
* Refs #33348 -- Improved messages raised by ↵Baptiste Mispelon2022-02-151-77/+53
| | | | | | | SimpleTestCase.assertFormError()/assertFormsetErrors(). This makes messages use BaseFormSet/BaseForm.__repr__() instead of context, and adds the _assert_form_error() helper.
* Refs #33348 -- Made SimpleTestCase.assertFormsetErrors() raise an error when ↵Baptiste Mispelon2022-02-141-0/+27
| | | | form_index is too big.
* Refs #33348 -- Made SimpleTestCase.assertFormError()/assertFormsetErrors() ↵Baptiste Mispelon2022-02-141-2/+12
| | | | raise an error for unbound forms/formsets.
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-071-5/+5
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-077-563/+653
|
* Refs #33476 -- Refactored problematic code before reformatting by Black.Mariusz Felisiak2022-02-031-7/+2
| | | | | | | | | | | | | | | | | 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], )
* Refs #33348 -- Deprecated passing errors=None to ↵Baptiste Mispelon2022-01-061-1/+30
| | | | SimpleTestCase.assertFormError()/assertFormsetErrors().
* Fixed #33410 -- Fixed recursive capturing of callbacks by ↵Petter Friberg2022-01-061-0/+52
| | | | | | TestCase.captureOnCommitCallbacks(). Regression in d89f976bddb49fb168334960acc8979c3de991fa.
* Fixed #33400 -- Added support for msg_prefix and count arguments to ↵Ad Timmering2022-01-051-5/+43
| | | | assertTemplateUsed()/assertTemplateNotUsed() used as context managers.
* Fixed #33346 -- Fixed SimpleTestCase.assertFormsetError() crash on a formset ↵Baptiste Mispelon2021-12-081-0/+10
| | | | | | | | named "form". Thanks OutOfFocus4 for the report. Regression in 456466d932830b096d39806e291fe23ec5ed38d5.
* Fixed #33333 -- Fixed setUpTestData() crash with models.BinaryField on ↵Mariusz Felisiak2021-12-032-0/+21
| | | | | | | | | PostgreSQL. This makes models.BinaryField pickleable on PostgreSQL. Regression in 3cf80d3fcf7446afdde16a2be515c423f720e54d. Thanks Adam Zimmerman for the report.
* Refs #33301 -- Made SimpleTestCase.assertFormError()/assertFormsetErrors() ↵Baptiste Mispelon2021-11-261-7/+21
| | | | raise ValueError for non test client responses.
* Added tests for SimpleTestCase.assertFormError()/assertFormsetErrors().Baptiste Mispelon2021-11-261-1/+269
|
* Fixed #33278 -- Improved error for connection/query attempts against ↵SwastikTripathi2021-11-153-9/+11
| | | | disallowed databases in tests.
* Fixed #33236 -- Fixed assertHTMLEqual() error messages for escaped HTML.Pratyush Mittal2021-10-291-0/+16
|
* Refs #31235 -- Made assertQuerysetEqual() not call repr() on a queryset when ↵Mariusz Felisiak2021-09-201-29/+2
| | | | | | compared to string values. Per deprecation timeline.
* Refs #31395 -- Removed support for assigning objects which don't support ↵Mariusz Felisiak2021-09-201-23/+1
| | | | | | deepcopy() in setUpTestData(). Per deprecation timeline.
* Fixed #33054 -- Made TestCase.captureOnCommitCallbacks() capture callbacks ↵Eugene Morozov2021-08-301-0/+7
| | | | recursively.
* Refs #32508 -- Raised ImproperlyConfigured/TypeError instead of using "assert".Mateo Radman2021-07-051-0/+10
|
* Made SerializeMixin check lockfile attr at import time.Adam Johnson2021-06-041-0/+21
|
* Fixed #32556 -- Fixed handling empty string as non-boolean attributes value ↵Baptiste Mispelon2021-03-191-3/+18
| | | | by assertHTMLEqual().
* Fixed #32556 -- Fixed assertHTMLEqual() to handle empty string as boolean ↵Hasan Ramezani2021-03-181-0/+6
| | | | attributes value.
* Refs #21429 -- Added SimpleTestCase.assertNoLogs() on Python < 3.10.François Freitag2021-03-021-0/+43
|
* Fixed typo in assertQuerysetEqual() exception message.Jacob Walls2021-02-261-1/+4
|
* Fixed #32469 -- Made assertQuerysetEqual() respect maxDiff when ordered=False.Nick Pope2021-02-221-0/+31
|
* Fixed #31235 -- Made assertQuerysetEqual() compare querysets directly.Hasan Ramezani2020-11-061-11/+57
| | | | | | | | 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>
* Fixed #27906 -- Fixed test tools counting of HTML matches for subsets of ↵Jacob Walls2020-09-241-1/+20
| | | | | | elements. Previously examples such as '<a/><b/>' would not match in '<a/><b/><c/>'.
* Fixed #31944 -- Used addCleanup() to register TestContextDecorator cleanups.François Freitag2020-09-071-0/+23
| | | | | | 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.
* Fixed #30457 -- Added TestCase.captureOnCommitCallbacks().Adam Johnson2020-07-131-1/+68
|
* Fixed #31395 -- Made setUpTestData enforce in-memory data isolation.Simon Charette2020-05-152-3/+99
| | | | | | | | | | | | | Since it's introduction in Django 1.8 setUpTestData has been suffering from a documented but confusing caveat due to its sharing of attributes assigned during its execution with all test instances. By keeping track of class attributes assigned during the setUpTestData phase its possible to ensure only deep copies are provided to test instances on attribute retreival and prevent manual setUp gymnastic to work around the previous lack of in-memory data isolation. Thanks Adam Johnson for the extensive review.
* Capitalized Unicode in docs, strings, and comments.Jon Dufresne2020-04-201-2/+2
|
* Removed unused __str__() methods in tests models.Author: Mads Jensen2020-04-151-6/+0
| | | | | Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-Authored-By: Hasan Ramezani <hasan.r67@gmail.com>
* Removed unused and incorrect PossessedCar.__str__() method in test_utils.Mariusz Felisiak2020-02-141-3/+0
| | | PossessedCar doesn't have a color.