summaryrefslogtreecommitdiff
path: root/tests/basic
AgeCommit message (Collapse)Author
2015-11-21Fixed #25715 -- Fixed Model.refresh_from_db() with ForeignKey ↵Tim Graham
w/on_delete=SET_NULL.
2015-09-23Refs #21414 -- Removed Field.related per deprecation timeline.Tim Graham
2015-08-22Tweak some examples.Aymeric Augustin
"Area man/woman" is confusing to people not familiar with the conventions of American journalism (like me).
2015-07-27Fixed #21127 -- Started deprecation toward requiring on_delete for ↵Flavio Curella
ForeignKey/OneToOneField
2015-05-20Refs #24652 -- Used SimpleTestCase where appropriate.Simon Charette
2015-04-06Fixed #24584 -- Fixed microsecond handling with older MySQLdbJon Dufresne
2015-03-25Renamed Field.rel attribute to remote_fieldAnssi Kääriäinen
Field.rel is now deprecated. Rel objects have now also remote_field attribute. This means that self == self.remote_field.remote_field. In addition, made the Rel objects a bit more like Field objects. Still, marked ManyToManyFields as null=True.
2015-02-27Fixed #24418 -- Prevented crash in refresh_from_db with null fkClaude Paroz
Thanks Johannes Lerch for the report, Tim Graham for the test case, and Simon Charette for the review.
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-01-30Reverted "Fixed #6785 -- Made QuerySet.get() fetch a limited number of rows."Tim Graham
This reverts commit da79ccca1d34f427952cce4555e598a700adb8de. This optimized the unsuccessful case at the expense of the successful one.
2015-01-30Fixed #24211 -- Removed ValuesQuerySet() and ValuesListQuerySet().Loic Bistuer
Thanks Anssi Kääriäinen, Marc Tamlyn, and Tim Graham for the reviews.
2015-01-20Fixed typos in code comments.Adam Taylor
2015-01-06Fixed #12663 -- Formalized the Model._meta API for retrieving fields.Daniel Pyrathon
Thanks to Russell Keith-Magee for mentoring this Google Summer of Code 2014 project and everyone else who helped with the patch!
2014-12-23Fixed #21414 -- Removed RelatedObject and deprecated Field.related.Anssi Kääriäinen
2014-11-28Fixed #901 -- Added Model.refresh_from_db() methodAnssi Kääriäinen
Thanks to github aliases dbrgn, carljm, slurms, dfunckt, and timgraham for reviews.
2014-11-20Added a comment for test of refs #20278.Anssi Kääriäinen
2014-11-12Fixed #22967 -- Made Model._do_update consistentJozef Knaperek
Made _do_update behave more strictly according to its docs, including a corner case when specific concurent updates are executed and select_on_save is set.
2014-11-03Fixed #23620 -- Used more specific assertions in the Django test suite.Berker Peksag
2014-10-07Refactored model lookup tests; refs #18586.Browniebroke
2014-09-29Replaced set([foo, ...]) by {foo, ...} literals. Refs PR 3282.Thomas Chaumeny
Thanks Collin Anderson for the review.
2014-09-24Removed numbering from the models.py header of some test packages.Loic Bistuer
This is a reliqua from the early days of the modeltests/regressiontests era.
2014-07-02assertEquals -> assertEqualTim Graham
2014-06-25Split tests.basic.ModelTests in several tests; refs #18586.zsoldosp
2014-05-15Harmonized some PEP 0263 coding preamblesClaude Paroz
2014-03-21Removed legacy transaction management per the deprecation timeline.Aymeric Augustin
2014-03-03Fixed many typos in comments and docstrings.Rodolfo Carvalho
Thanks Piotr Kasprzyk for help with the patch.
2013-11-02PEP8 cleanupJason Myers
Signed-off-by: Jason Myers <jason@jasonamyers.com>
2013-10-26Fix all violators of E231Alex Gaynor
2013-10-23Fixed #21298 -- Fixed E301 pep8 warningsAlasdair Nicol
2013-10-21Fixed #21288 -- Fixed E126 pep8 warningsAlasdair Nicol
2013-10-18Fixed #21287 -- Fixed E123 pep8 warningsAlasdair Nicol
2013-10-10Used "is" for comparisons with None.Tim Graham
2013-09-08Removed some more unused local varsAlex Gaynor
2013-09-02Replaced "not PY3" by "PY2", new in six 1.4.0.Aymeric Augustin
2013-08-30Fixed #20988 -- Added model meta option select_on_saveAnssi Kääriäinen
The option can be used to force pre 1.6 style SELECT on save behaviour. This is needed in case the database returns zero updated rows even if there is a matching row in the DB. One such case is PostgreSQL update trigger that returns NULL. Reviewed by Tim Graham. Refs #16649
2013-08-22Fixed model.__eq__ and __hash__ for no pk value casesAnssi Kääriäinen
The __eq__ method now considers two instances without primary key value equal only when they have same id(). The __hash__ method raises TypeError for no primary key case. Fixed #18864, fixed #18250 Thanks to Tim Graham for docs review.
2013-08-19Made Model.__eq__ consider proxy models equivalentAnssi Kääriäinen
Fixed #11892, fixed #16458, fixed #14492.
2013-07-31Fixed #20826 -- Moved Manager.raw() and Manager._insert() to the QuerySet class.Loic Bistuer
2013-07-29Removed most of absolute_import importsClaude Paroz
Should be unneeded with Python 2.7 and up. Added some unicode_literals along the way.
2013-07-26Fixed #20625 -- Chainable Manager/QuerySet methods.Loic Bistuer
Additionally this patch solves the orthogonal problem that specialized `QuerySet` like `ValuesQuerySet` didn't inherit from the current `QuerySet` type. This wasn't an issue until now because we didn't officially support custom `QuerySet` but it became necessary with the introduction of this new feature. Thanks aaugustin, akaariai, carljm, charettes, mjtamlyn, shaib and timgraham for the reviews.
2013-07-08Fixed #6785 -- Made QuerySet.get() fetch a limited number of rows.Tim Graham
Thanks Patryk Zawadzki.
2013-06-10Defined available_apps in relevant tests.Aymeric Augustin
Fixed #20483.
2013-05-21Use assertIsInstance in tests.Marc Tamlyn
Gives much nicer errors when it fails.
2013-05-20Fixed #20278 -- ensured .get() exceptions do not recurse infinitelyAnssi Kääriäinen
A regression caused by d5b93d3281fe93cbef5de84a52 made .get() error reporting recurse infinitely on certain rare conditions. Fixed this by not trying to print the given lookup kwargs.
2013-03-20Revert "Fixed 19895 -- Made second iteration over invalid queryset raise an ↵Claude Paroz
exception too" This reverts commit 2cd0edaa477b327024e4007c8eaf46646dcd0f21. This commit was the cause of a memory leak. See ticket for more details. Thanks Anssi Kääriäinen for identifying the source of the bug.
2013-03-14Fixed #16649 -- Refactored save_base logicAnssi Kääriäinen
Model.save() will use UPDATE - if not updated - INSERT instead of SELECT - if found UPDATE else INSERT. This should save a query when updating, but will cost a little when inserting model with PK set. Also fixed #17341 -- made sure .save() commits transactions only after the whole model has been saved. This wasn't the case in model inheritance situations. The save_base implementation was refactored into multiple methods. A typical chain for inherited save is: save_base() _save_parents(self) for each parent: _save_parents(parent) _save_table(parent) _save_table(self)
2013-02-26Merged regressiontests and modeltests into the test root.Florian Apolloner