summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
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-19Fixed #16319 -- added SuccessMessageMixin to contrib.messagesPaul Collins
Thanks martinogden for the initial patch and d1ffuz0r for tests.
2013-03-19Fixed a python 3.2 syntax error and python 3 warning introduced by 054ce2aa02.Simon Charette
2013-03-19Refs #18586 -- Split out long custom_columns lookup test into multiple tests.konarkmodi
2013-03-19Fixed #20088 -- Changed get_admin_log not to depend on User id fieldJuan Catalano
Before this change, the get_admin_log method would expect User model's FK to be named `id`. When changing that FK name, admin/index.html rendering would fail. This includes: * Changed the use of id for the use of pk property. * Added a regression test that fails without the patch. This commit refs #20088.
2013-03-18Fixed #19327 -- Added handling of double login attempts in admin.Deric Crago
Thanks to Krzysztof Jurewicz for initial patch and adupin for tests.
2013-03-18Fixed #13260 -- Quoted arguments interpolated in URLs in reverse.Aymeric Augustin
2013-03-18Fixed #19456 -- Avoid infinite recursion when tracing LazyObject.__init__.Aymeric Augustin
Thanks blaze33 for the patch.
2013-03-18Fixed #18447 -- Made LazyObject unwrap on dict access.Aymeric Augustin
Thanks Roman Gladkov and Zbigniew Siciarz.
2013-03-18Fixed #17037 -- Added a --all option to diffsettings.Aymeric Augustin
2013-03-17Removed debug codeAnssi Kääriäinen
2013-03-16Fix #20058: Make compilemessages use stdout instead of stderr.Baptiste Mispelon
2013-03-15Fixed #17502 -- Made joining in inheritance cases consistentAnssi Kääriäinen
The original problem was that when filtering two levels up in inheritance chain, Django optimized the join generation so that the middle model was skipped. But then Django generated joins from top to middle to bottom for SELECT clause, and thus there was one extra join (top->middle->bottom + top -> bottom). This case is fixed in master as the filtering optimization is gone. This has the side effect that in some cases there is still extra join if the SELECT clause doesn't contain anything from middle or bottom.
2013-03-14Deprecated django.views.defaults.shortcut.Aymeric Augustin
2013-03-14Fixed #17051 -- Removed some 'invalid' field error messagesClaude Paroz
When the 'invalid' error message is set at field level, it masks the error message raised by the validator, if any.
2013-03-14Add a specific error message for URLValidatorClaude Paroz
2013-03-14Fixed #20039 -- Fixed has_changed form detection for required TypedChoiceFieldsClaude Paroz
Thanks Florian Apolloner for the report and the review. Also fixes #19643.
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-03-13Began implementing a shared set of test models to speed up tests.Florian Apolloner
2013-03-13Merge pull request #900 from bmispelon/ticket-20022Jacob Kaplan-Moss
Fix #20022: Correctly handle prefixes with url-unsafe characters in reverse()
2013-03-13Fix #20022: Correctly handle prefixes with url-unsafe characters in reverse().Baptiste Mispelon
2013-03-13Made atomic usable when autocommit is off.Aymeric Augustin
Thanks Anssi for haggling until I implemented this. This change alleviates the need for atomic_if_autocommit. When autocommit is disabled for a database, atomic will simply create and release savepoints, and not commit anything. This honors the contract of not doing any transaction management. This change also makes the hack to allow using atomic within the legacy transaction management redundant. None of the above will work with SQLite, because of a flaw in the design of the sqlite3 library. This is a known limitation that cannot be lifted without unacceptable side effects eg. triggering arbitrary commits.
2013-03-13Fixed failing aggregation tests on MySQLAnssi Kääriäinen
2013-03-13Refactored qs.add_q() and utils/tree.pyAnssi Kääriäinen
The sql/query.py add_q method did a lot of where/having tree hacking to get complex queries to work correctly. The logic was refactored so that it should be simpler to understand. The new logic should also produce leaner WHERE conditions. The changes cascade somewhat, as some other parts of Django (like add_filter() and WhereNode) expect boolean trees in certain format or they fail to work. So to fix the add_q() one must fix utils/tree.py, some things in add_filter(), WhereNode and so on. This commit also fixed add_filter to see negate clauses up the path. A query like .exclude(Q(reversefk__in=a_list)) didn't work similarly to .filter(~Q(reversefk__in=a_list)). The reason for this is that only the immediate parent negate clauses were seen by add_filter, and thus a tree like AND: (NOT AND: (AND: condition)) will not be handled correctly, as there is one intermediary AND node in the tree. The example tree is generated by .exclude(~Q(reversefk__in=a_list)). Still, aggregation lost connectors in OR cases, and F() objects and aggregates in same filter clause caused GROUP BY problems on some databases. Fixed #17600, fixed #13198, fixed #17025, fixed #17000, fixed #11293.
2013-03-12Fixed #19964 -- Removed relabel_aliases from some structsAnssi Kääriäinen
Before there was need to have both .relabel_aliases() and .clone() for many structs. Now there is only relabeled_clone() for those structs where alias is the only mutable attribute.
2013-03-12Fixed #20028 -- Made atomic usable on callable instances.Aymeric Augustin
Thanks Anssi for the report.
2013-03-11Fixed tests that relied on MANAGERS not being empty.Aymeric Augustin
Regression in d0561242.
2013-03-11Remove a special case for comment tests from runtests.py.Jacob Kaplan-Moss
2013-03-11Adjusted query counts to account for new savepoints.Aymeric Augustin
2013-03-11Ran a test that closes the database connection outside of a transaction.Aymeric Augustin
2013-03-11Removed forced settings in runtestsClaude Paroz
Tests that require USE_I18N, LOGIN_URL or certain MIDDLEWARE_CLASSES should be decorated appropriately.
2013-03-11Improved the API of set_autocommit.Aymeric Augustin
2013-03-11Removed a test that no longer makes any sense.Aymeric Augustin
Since unmanaged == autocommit, there's nothing to commit or roll back.
2013-03-11Updated a test that doesn't make sense with autocommit.Aymeric Augustin
2013-03-11Added an option to disable the creation of savepoints in atomic.Aymeric Augustin
2013-03-11Deprecated TransactionMiddleware and TRANSACTIONS_MANAGED.Aymeric Augustin
Replaced them with per-database options, for proper multi-db support. Also toned down the recommendation to tie transactions to HTTP requests. Thanks Jeremy for sharing his experience.
2013-03-11Added some assertions to enforce the atomicity of atomic.Aymeric Augustin
2013-03-11Implemented an 'atomic' decorator and context manager.Aymeric Augustin
Currently it only works in autocommit mode. Based on @xact by Christophe Pettus.
2013-03-11Added support for savepoints in SQLite.Aymeric Augustin
Technically speaking they aren't usable yet.
2013-03-11Deprecated transaction.is_managed().Aymeric Augustin
It's synchronized with the autocommit flag.
2013-03-11Deprecated transaction.commit/rollback_unless_managed.Aymeric Augustin
Since "unless managed" now means "if database-level autocommit", committing or rolling back doesn't have any effect. Restored transactional integrity in a few places that relied on automatically-started transactions with a transitory API.
2013-03-11Enabled autocommit for PostgreSQL.Aymeric Augustin
For users who didn't activate autocommit in their database options, this is backwards-incompatible in "non-managed" aka "auto" transaction state. This state now uses database-level autocommit instead of ORM-level autocommit. Also removed the uses_autocommit feature which lost its purpose.
2013-03-11Separated autocommit and isolation level handling for PostgreSQL.Aymeric Augustin
Autocommit cannot be manipulated independently from an open connection. This commit introduces a minor change in behavior: entering transaction management forces opening a databasse connection. This shouldn't be backwards incompatible in any practical use case.
2013-03-11Made transaction.managed a no-op and deprecated it.Aymeric Augustin
enter_transaction_management() was nearly always followed by managed(). In three places it wasn't, but they will all be refactored eventually. The "forced" keyword argument avoids introducing behavior changes until then. This is mostly backwards-compatible, except, of course, for managed itself. There's a minor difference in _enter_transaction_management: the top self.transaction_state now contains the new 'managed' state rather than the previous one. Django doesn't access self.transaction_state in _enter_transaction_management.
2013-03-10Fixed #20019 -- Ensured HttpRequest.resolver_match always exists.Aymeric Augustin
Obviously it isn't set until the URL is resolved.
2013-03-10Made (make|compile)messages check for availability of gettext commands.Ramiro Morales
Refs #19584.
2013-03-09Fixed #19923 -- Display tracebacks for non-CommandError exceptionsClaude Paroz
By default, show tracebacks for management command errors when the exception is not a CommandError. Thanks Jacob Radford for the report.
2013-03-08Fixed a regression in forms changed_dataClaude Paroz
Thanks Loic Bistuer for spotting the regression and the initial patch. Refs #16612.
2013-03-08Fixed #15363 -- Renamed and normalized to `get_queryset` the methods that ↵Loic Bistuer
return a QuerySet.
2013-03-07Merge pull request #850 from bmispelon/ticket-19916Aymeric Augustin
Fix 19916. Smarter tokenizing of contrib.comment's templatetags arguments