Commit Graph

87 Commits

Author SHA1 Message Date
Tim Graham c0c7fa4837 Refs #25050 -- Corrected test assertion in serializers test. 2015-07-03 08:03:20 -04:00
Grégoire ROCHER c6cce4de38 Fixed #25050 -- Allowed serialization of models with deferred fields. 2015-07-02 14:46:16 -04:00
Claude Paroz 9368f51e12 Fixed #20197 -- Made XML serializer fail loudly when outputting unserializable chars
Thanks Tim Graham for the review.
2015-06-19 20:54:46 +02:00
mick 211c19c579 Fix for ticket 12685 2015-06-10 10:20:51 +01:00
Simon Charette be67400b47 Refs #24652 -- Used SimpleTestCase where appropriate. 2015-05-20 13:46:13 -04:00
Richard Eames 727e40c879 Fixed #19820 -- Added more helpful error messages to Python deserializer. 2015-04-09 10:56:33 -04:00
Simon Charette 5bc3123479 Fixed #24558 -- Made dumpdata mapping ordering deterministic.
Thanks to gfairchild for the report and Claude for the review.
2015-04-02 15:21:43 -04:00
Marc Tamlyn 32d4db66b9 Update converters to take a consistent set of parameters.
As suggested by Anssi. This has the slightly strange side effect of
passing the expression to Expression.convert_value has the expression
passed back to it, but it allows more complex patterns of expressions.
2015-02-20 11:35:52 +00:00
Tim Graham 0ed7d15563 Sorted imports with isort; refs #23860. 2015-02-06 08:16:28 -05:00
Anssi Kääriäinen 0c7633178f Fixed #24020 -- Refactored SQL compiler to use expressions
Refactored compiler SELECT, GROUP BY and ORDER BY generation.
While there, also refactored select_related() implementation
(get_cached_row() and get_klass_info() are now gone!).

Made get_db_converters() method work on expressions instead of
internal_type. This allows the backend converters to target
specific expressions if need be.

Added query.context, this can be used to set per-query state.

Also changed the signature of database converters. They now accept
context as an argument.
2015-01-08 14:07:54 -05:00
Loic Bistuer 2f3a4cd573 Removed numbering from the models.py header of some test packages.
This is a reliqua from the early days of the modeltests/regressiontests era.
2014-09-24 17:28:56 +07:00
Marc Tamlyn e9103402c0 Fixed #18757, #14462, #21565 -- Reworked database-python type conversions
Complete rework of translating data values from database

Deprecation of SubfieldBase, removal of resolve_columns and
convert_values in favour of a more general converter based approach and
public API Field.from_db_value(). Now works seamlessly with aggregation,
.values() and raw queries.

Thanks to akaariai in particular for extensive advice and inspiration,
also to shaib, manfre and timograham for their reviews.
2014-09-03 20:36:03 +01:00
Tim Graham 99f5ea9cc8 Fixed #22653 -- Added some database feature flags to tests.
Thanks Rahul Priyadarshi.
2014-06-11 11:45:18 -04:00
Aymeric Augustin 0f9560855e Removed legacy transaction management per the deprecation timeline. 2014-03-21 21:06:50 +01:00
Aymeric Augustin e32095616c Imported override_settings from its new location. 2013-12-23 21:37:56 +01:00
Baptiste Mispelon 621c25c419 Added missing deconstruct() methods. 2013-12-06 15:23:34 +01:00
Jason Myers c3791463a5 Fixing E302 Errors
Signed-off-by: Jason Myers <jason@jasonamyers.com>
2013-11-02 23:48:47 -05:00
Tim Graham 36ded01527 Fixed #21302 -- Fixed unused imports and import *. 2013-11-02 15:24:56 -04:00
Alex Gaynor b35ff0d920 Fixed all the E203 violations 2013-10-26 18:27:42 -07:00
Alex Gaynor 9d740eb8b1 Fix all violators of E231 2013-10-26 12:15:03 -07:00
Bouke Haarsma 3565efaa45 Removed some direct settings manipulations in tests; refs #21230. 2013-10-21 11:31:05 -04:00
Tim Graham 96d1d4e292 Removed unused local variables in tests. 2013-10-19 08:31:38 -04:00
Alasdair Nicol dfb4cb9970 Fixed #21285 -- Fixed E121,E122 pep8 warnings 2013-10-17 20:20:11 -04:00
Kevin Christopher Henry 9d700322b3 Fixed #19885 -- cleaned up the django.test namespace
* override_settings may now be imported from django.test
* removed Approximate from django.test
* updated documentation for things importable from django.test

Thanks akaariai for the suggestion.
2013-09-09 16:03:13 -04:00
Tim Graham b7451b72ed Fixed deprecation warning on Python 3 2013-09-06 20:36:17 -04:00
Roberto Aguilar 01a5359477 Cleanup commit after peer review. 2013-09-06 22:45:31 +00:00
Roberto Aguilar ca3ac4a3e3 Updated NoYamlSerializerTestCase to run with yaml.
In order to verify the behavior of using the yaml serializer when yaml
is on the system, fake the ImportError when the serializer is being
registered.
2013-09-06 22:26:13 +00:00
Roberto Aguilar d8d61d8260 Added tests for missing pyyaml.
This test makes sure an YAML import errors are communicated to the
caller rather than stating the serializer does not exist.
2013-09-06 20:23:27 +00:00
Tim Graham 5649c0af9d Fixed "indentation is not a multiple of four" pep8 issues. 2013-09-03 14:22:21 -04:00
Ramiro Morales c01cd4c423 Change test added in 3e34005b1b to be more stable.
It could fail when actual serialization JSON field ordering was
different from the hard-coded one. Refs #13182.
2013-09-01 10:47:35 -03:00
Claude Paroz e0643cb676 Properly skipped yaml tests when not installed 2013-08-31 15:23:56 +02:00
Claude Paroz 3e34005b1b Fixed #13182 -- Prevented trailing spaces in indented json output
Thanks Stéphane Raimbault for the report and the initial patch.
2013-08-31 15:18:01 +02:00
Claude Paroz 5c1143910e Removed most of absolute_import imports
Should be unneeded with Python 2.7 and up.
Added some unicode_literals along the way.
2013-07-29 20:28:13 +02:00
Aymeric Augustin cfcf4b3605 Stopped using django.utils.unittest in the test suite.
Refs #20680.
2013-07-01 14:29:33 +02:00
Aymeric Augustin c6e6d4eeb7 Defined available_apps in relevant tests.
Fixed #20483.
2013-06-10 11:30:01 +02:00
Aymeric Augustin 7aacde84f2 Made transaction.managed a no-op and deprecated it.
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-11 14:48:53 +01:00
Florian Apolloner 89f40e3624 Merged regressiontests and modeltests into the test root. 2013-02-26 14:36:57 +01:00