Commit Graph

6295 Commits

Author SHA1 Message Date
Collin Anderson 3d2cae0896 Fixed #24072 -- Added FileResponse for streaming binary files. 2015-01-05 10:51:52 -05:00
Andriy Sokolovskiy 23f1a8dad2 Added return value to Signal.disconnect(). 2015-01-02 12:00:41 -05:00
Tim Graham 937fab030d Renamed an assertion in the dispatch tests. 2015-01-02 11:29:06 -05:00
Daniel Pyrathon 8958170755 Fixed #9104 -- Moved FieldDoesNotExist to core.exceptions 2015-01-02 10:46:04 -05:00
Claude Paroz 1aa3e09c20 Fixed #23745 -- Reused states as much as possible in migrations
Thanks Tim Graham and Markus Holtermann for the reviews.
2015-01-02 15:37:10 +01:00
Claude Paroz 2a9c4b4901 Passed around the state between migrations
Refs #23745.
2015-01-02 15:37:10 +01:00
Claude Paroz a159b1facd Replaced migration state render() by apps cached property
Refs #23745.
2015-01-02 15:19:36 +01:00
Tim Graham 40ccef16cb Silenced an ImportWarning in the template_backends tests. 2015-01-01 14:28:53 -05:00
Tim Graham b9feec959b Fixed #23700 -- Fixed non-deterministic static files test failures on Windows.
This partially reverts commit 949ee521fa
refs #21230.
2015-01-01 13:57:52 -05:00
Tim Graham 40a8504357 Fixed #23891 -- Moved deprecation of IPAddressField to system check framework.
Thanks Markus Holtermann for review.
2015-01-01 13:30:52 -05:00
Thomas Tanner 46068d850d Fixed #22295 -- Replaced permission check for displaying admin user-tools 2014-12-31 16:31:59 -05:00
Andrey Maslov 7a878ca5cb Fixed #24008 -- Fixed ValidationError crash with list of dicts. 2014-12-31 14:43:13 -05:00
Markus Holtermann a1487deebf Fixed #23359 -- Added showmigrations command to list migrations and plan.
Thanks to Collin Anderson, Tim Graham, Gabe Jackson, and Marc Tamlyn
for their input, ideas, and review.
2014-12-31 14:14:28 -05:00
Will Earp 8952757698 Refs #18586 -- Split up tests.defer.DeferTests.test_defer 2014-12-31 11:56:06 -05:00
Tim Graham 8a9b0c15a6 Renamed tests for util -> utils moves; refs #17627. 2014-12-31 11:26:27 -05:00
Tim Graham 837fc2d8cd Fixed a queries test on Python 2 broken after importing six.moves.range(). 2014-12-31 09:50:47 -05:00
Tim Graham 63dee96cc7 Fixed test from refs #23758. 2014-12-31 09:19:04 -05:00
Piotr Pawlaczek 41fc1c0b5e Fixed #23758 -- Allowed more than 5 levels of subqueries
Refactored bump_prefix() to avoid infinite loop and allow more than
than 5 subquires by extending the alphabet to use multi-letters.
2014-12-31 08:48:28 -05:00
Tim Graham 93d73dac91 Moved DatabaseCreation.data_types properties to DatabaseWrapper.
refs #22340.
2014-12-31 08:29:17 -05:00
Berker Peksag 32ca159c96 Ignored warnings correctly in test_get_formsets_with_inlines_returns_tuples().
The subclass check in ModelAdmin.get_formsets_with_inlines() wasn't
tested correctly because of the super() call in
EpisodeAdmin.get_formsets().
2014-12-31 08:24:09 -05:00
Claude Paroz 51890ce889 Applied ignore_warnings to Django tests 2014-12-30 18:16:25 +01:00
Tim Graham df3cc53fda Fixed #23450 -- Fixed transient failure of requests...test_far_expiration. 2014-12-30 10:23:42 -05:00
Tim Graham c6b12bc995 Removed unused import. 2014-12-30 10:23:29 -05:00
Andriy Sokolovskiy 8c99b7920e Fixed #12118 -- Added shared cache support to SQLite in-memory testing. 2014-12-30 10:14:33 -05:00
Markus Holtermann fca866763a Added test for an intermediate swappable model change in migration state.
refs #22563
2014-12-30 10:01:25 -05:00
Tim Graham ab4f709da4 Fixed #23581 -- Prevented extraneous DROP DEFAULT statements.
Thanks john_scott for the report and Markus Holtermann for review.
2014-12-30 07:54:05 -05:00
Markus Holtermann 623ccdd598 Fixed #23938 -- Added migration support for m2m to concrete fields and vice versa
Thanks to Michael D. Hoyle for the report and Tim Graham for the review.
2014-12-29 13:41:12 -05:00
Claude Paroz 3c5d1edb39 Fixed #22279 -- Prevented dummy backend going through DatabaseErrorWrapper
Thanks Daniel Hahler for the report and Tim Graham for the review.
2014-12-29 19:06:28 +01:00
Claude Paroz 1d24f073e6 Fixed #21255 -- Closed connections after management command ran
Thanks kabakov.as@gmail.com for the report, and Aymeric Augustin,
Simon Charette for the reviews.
2014-12-29 19:02:45 +01:00
Berker Peksag bae404dea3 Converted middleware tests to use RequestFactory. 2014-12-29 19:36:18 +02:00
Ramiro Morales 6fb9dee470 Fixed #23271 -- Don't corrupt PO files on Windows when updating them.
Make sure PO catalog text fetched from gettext programs via standard
output isn't corrupted by mismatch between assumed (UTF-8) and real
(CP1252) encodings. This can cause mojibake to be written when creating
or updating PO files.

Also fixes #23311.

Thanks to contributor with Trac nick 'danielmenzel' for the report,
excellent research and fix.
2014-12-29 12:24:50 -03:00
Josh Smeaton 1cdfbde4db Fixed #23753 -- Oracle failure with Coalesce 2014-12-29 19:44:13 +11:00
Aymeric Augustin b7282db833 Raised a warning when using the legacy TEMPLATE_* settings.
All tests now rely on TEMPLATES.
2014-12-28 17:02:31 +01:00
Aymeric Augustin 9eb4f28e89 Deprecated TEMPLATE_CONTEXT_PROCESSORS. 2014-12-28 17:02:31 +01:00
Aymeric Augustin d3205e3e2e Deprecated TEMPLATE_DIRS. 2014-12-28 17:02:30 +01:00
Aymeric Augustin cf0fd65ed4 Deprecated TEMPLATE_LOADERS. 2014-12-28 17:02:30 +01:00
Aymeric Augustin d3a982556d Deprecated TEMPLATE_STRING_IF_INVALID. 2014-12-28 17:02:30 +01:00
Aymeric Augustin 3dc01aaaaf Deprecated ALLOWED_INCLUDE_ROOTS. 2014-12-28 17:02:30 +01:00
Aymeric Augustin cf1f36bb6e Deprecated current_app in TemplateResponse and render(_to_response). 2014-12-28 17:02:29 +01:00
Aymeric Augustin fdbfc98003 Deprecated some arguments of django.shortcuts.render(_to_response).
dictionary and context_instance and superseded by context.

Refactored tests that relied context_instance with more modern idioms.
2014-12-28 17:02:29 +01:00
Aymeric Augustin 92e8f1f302 Moved context_processors from django.core to django.template. 2014-12-28 17:00:07 +01:00
Aymeric Augustin 969e082858 Added tests for django.template.loader.
Deprecated features aren't tested.
2014-12-28 17:00:07 +01:00
Aymeric Augustin 90805b240f Supported multiple template engines in render_to_string.
Adjusted its API through a deprecation path according to the DEP.
2014-12-28 16:23:02 +01:00
Aymeric Augustin 5523e4cdbb Removed private API find_template.
It wasn't documented and it wasn't used anywhere, except in a few tests
that don't test it specifically and can be rewritten with get_template.
2014-12-28 16:23:01 +01:00
Aymeric Augustin 4ea43ac915 Supported multiple template engines in get_template and select_template.
This commit changes the return type of these two functions. Instead of
returning a django.template.Template they return a backend-specific
Template class that must implement render(self, context).
2014-12-28 16:23:01 +01:00
Aymeric Augustin 92a2d049a2 Isolated template tests from Django settings. 2014-12-28 16:23:01 +01:00
Aymeric Augustin 332154e726 Added basic tests for template backends. 2014-12-28 16:23:00 +01:00
Aymeric Augustin 7eefdbf7ab Cleaned up the django.template namespace.
Since this package is going to hold both the implementation of the Django
Template Language and the infrastructure for Multiple Template Engines,
it should be untied from the DTL as much as possible within our
backwards-compatibility policy.

Only public APIs (i.e. APIs mentioned in the documentation) were left.
2014-12-28 14:47:31 +01:00
Aymeric Augustin 6d52f6f8e6 Fixed #23831 -- Supported strings escaped by third-party libs in Django.
Refs #7261 -- Made strings escaped by Django usable in third-party libs.

The changes in mark_safe and mark_for_escaping are straightforward. The
more tricky part is to handle correctly objects that implement __html__.

Historically escape() has escaped SafeData. Even if that doesn't seem a
good behavior, changing it would create security concerns. Therefore
support for __html__() was only added to conditional_escape() where this
concern doesn't exist.

Then using conditional_escape() instead of escape() in the Django
template engine makes it understand data escaped by other libraries.

Template filter |escape accounts for __html__() when it's available.
|force_escape forces the use of Django's HTML escaping implementation.

Here's why the change in render_value_in_context() is safe. Before Django
1.7 conditional_escape() was implemented as follows:

    if isinstance(text, SafeData):
        return text
    else:
        return escape(text)

render_value_in_context() never called escape() on SafeData. Therefore
replacing escape() with conditional_escape() doesn't change the
autoescaping logic as it was originally intended.

This change should be backported to Django 1.7 because it corrects a
feature added in Django 1.7.

Thanks mitsuhiko for the report.
2014-12-27 18:02:34 +01:00
Aymeric Augustin 5c5eb5fea4 Fixed an inconsistency introduced in 547b1810.
mark_safe and mark_for_escaping should have been kept similar.

On Python 2 this change has no effect. On Python 3 it fixes the use case
shown in the regression test for mark_for_escaping, which used to raise
a TypeError. The regression test for mark_safe is just for completeness.
2014-12-27 17:44:54 +01:00
Claude Paroz 2ceb10f3b0 Fixed #14180 -- Prevented unneeded index creation on MySQL-InnoDB
Thanks zimnyx for the report and Simon Charette, Tim Graham for
the reviews.
2014-12-27 12:52:44 +01:00
Josh Smeaton 4718296546 Fixed #23753 -- Added a suite of SQL Functions
Added functions and tests
Added docs and more tests
Added TextField converter to mysql backend
Aliased Value as V in example docs and tests
Removed unicode_compatible in example
Fixed console emulation in examples
2014-12-27 15:27:27 +11:00
Tim Graham 7c07612e90 Removed an unnecessary models file in the admin_scripts tests. 2014-12-26 19:31:54 -05:00
Tim Graham 75bbcfa332 Replaced sqlall in some bash_completion/admin_scripts tests.
sqlall will be removed in Django 1.9, so now's a good time to remove
its usage where it's not important.
2014-12-26 18:52:26 -05:00
Gavin Wahl b4e76f30d1 Fixed #23346 -- Fixed lazy() to lookup methods on the real object, not resultclasses.
Co-Authored-By: Rocky Meza <rmeza@fusionbox.com>
2014-12-26 11:30:34 -05:00
Niclas Olofsson 3daa9d60be Fixed #10414 -- Made select_related() fail on invalid field names. 2014-12-24 14:54:30 -05:00
Thomas Tanner b27db97b23 Fixed #22461 -- Added if-unmodified-since support to the condition decorator. 2014-12-24 12:33:57 -05:00
Claude Paroz fae551d765 Complemented pickle test for ValuesQuerySet with related field
Refs #14515.
2014-12-24 14:58:32 +01:00
Claude Paroz 7ce9644d93 Added a test to ensure bad assignation to M2M doesn't clear data
Refs #14394.
2014-12-24 14:18:00 +01:00
Tim Graham c5c235cd4f Fixed typo in test_utils comment. 2014-12-24 07:10:34 -05:00
Claude Paroz b3ebcb22a9 Ignored deprecation warnings for CreationIndexesTests 2014-12-24 10:45:53 +01:00
Claude Paroz 9699d8446e Moved test correction from 5b1fb0a75 2014-12-24 10:42:24 +01:00
Tim Graham 061caa5b38 Fixed #24037 -- Prevented data loss possibility when changing Meta.managed.
The migrations autodetector now issues AlterModelOptions operations for
Meta.managed changes instead of DeleteModel + CreateModel.

Thanks iambibhas for the report and Simon and Markus for review.
2014-12-23 14:25:31 -05:00
Claude Paroz 30cbd5d360 Replaced DatabaseCreation sql methods by schema editor equivalents
Also used schema editor in migrate to sync unmigrated apps (sync_apps).
Refs #22340. Thanks Tim Graham for the review.
2014-12-23 19:35:01 +01:00
Claude Paroz 15ba0d166f Added migration for site test app depending on contrib.sites 2014-12-23 19:01:33 +01:00
Claude Paroz 750dbb1133 Removed unneeded null param to ManyToManyField 2014-12-23 19:01:03 +01:00
Claude Paroz 90720d549a Removed admin_util test dependency on contrib.sites 2014-12-23 18:43:55 +01:00
Claude Paroz f05b03f3d7 Removed model_package test dependency on contrib.sites 2014-12-23 18:10:07 +01:00
Anssi Kääriäinen f233bf47dd Fixed #21414 -- Removed RelatedObject and deprecated Field.related. 2014-12-23 10:54:25 -05:00
Claude Paroz 9fecb86a52 Fixed #17946 -- Fixed deserialization of self-referencing M2M fields
Thanks Philip Mountifield for the report and excellent analysis, and
Simon Charette for the review.
2014-12-23 16:01:39 +01:00
Thomas Chaumeny 994d6137a2 Fixed #23792 -- Added test.utils.freeze_time() context manager. 2014-12-22 07:46:40 -05:00
Oscar Ramirez 54085b0f9b Fixed #23998 -- Added datetime.time support to migrations questioner. 2014-12-22 07:24:54 -05:00
Marc Tamlyn 936e87c97b Merge pull request #3765 from wlanslovenija/ticket_24034
Fixed #24034 -- Don't always overwrite deconstruct path.
2014-12-22 00:41:13 +00:00
Josh Schneier 9a23470072 Fixed #24017 -- Added python_2_unicode_compatible in db/migrations 2014-12-21 16:10:43 -05:00
Jernej Kos 7c50e7eecc Fixed #24034 -- Don't always overwrite deconstruct path.
Made deconstruct path overwriting for ArrayField conditional,
so it only occurs when the deconstructed field is an instance
of ArrayField itself and not a subclass.
2014-12-21 17:31:50 +01:00
Marc Tamlyn 57554442fe Fixed #2443 -- Added DurationField.
A field for storing periods of time - modeled in Python by timedelta. It
is stored in the native interval data type on PostgreSQL and as a bigint
of microseconds on other backends.

Also includes significant changes to the internals of time related maths
in expressions, including the removal of DateModifierNode.

Thanks to Tim and Josh in particular for reviews.
2014-12-20 18:28:29 +00:00
Tim Graham 995be4a137 Fixed refs #24007 test on Windows. 2014-12-19 14:11:17 -05:00
Claude Paroz 1d9fc5caa9 Made model_regress unpickling test CWD-independent
Refs #24007. Thanks Tim Graham for his help with the patch.
2014-12-19 18:37:32 +01:00
Claude Paroz 5b1fb0a75d Forward-ported test and release note from f46a16614
Refs #24015.
2014-12-18 21:17:17 +01:00
Claude Paroz 9bcd4d812c Fixed #23788 (2) -- Improved gettext version checker
Thanks Tim Graham for the report and initial patch.
2014-12-18 16:06:33 +01:00
Collin Anderson 4fb38b7307 Allowed Python executable names other than python in test from refs #24007. 2014-12-17 20:09:24 -05:00
Claude Paroz 108b8bf852 Fixed #24007 -- Ensure apps registry's ready before unpickling models
This prevents AppRegistryNotReady errors when unpickling Django
models from an external script.
2014-12-17 18:33:32 +01:00
Mosson, Andrew b7219c7ba5 Fixed #23497 -- Made admin system checks run for custom AdminSites. 2014-12-17 09:11:46 -05:00
Anssi Kääriäinen 1c5cbf5e5d Fixed #24002 -- GenericRelation filtering targets related model's pk
Previously Publisher.objects.filter(book=val) would target
book.object_id if book is a GenericRelation. This is inconsistent to
filtering over reverse foreign key relations, where the target is the
related model's primary key.
2014-12-17 10:04:52 +02:00
Tim Graham d2ff8a7241 Fixed #23975 -- Restored pre_migrate signal if all apps have migrations.
Thanks kmmbvnr for the report.
2014-12-16 18:34:25 -05:00
Preston Timmons f91d7366e0 Fixed #16028 -- Moved defaultfilters tests into template_tests. 2014-12-16 14:45:19 -05:00
Andriy Sokolovskiy 3dbbb8a89c Fixed #23983 -- Fixed a crash in migrations when adding order_with_respect_to to non-empty table. 2014-12-16 10:48:49 -05:00
Diego Guimarães ca013e652f Fixed #23995 -- Removed unnecessary calls to self.client.logout() in tests. 2014-12-16 09:12:46 -05:00
Michael Hall 4fada6f1c9 Fixed #23893: Added tzinfo to constant datetime in unit test
Added tzinfo to y2k constant (01/01/2000) in
custom_lookups.tests.DateTimeLookupTests.test_datetime_output_field
to fix warning message regarding naive datetimes.
2014-12-16 02:54:59 -07:00
Diego Guimarães c17d821fa7 Refs #23947 -- Improved migrations tests table cleanup.
Copied technique from schema tests.
2014-12-15 19:05:19 -05:00
Tim Graham ac5f2a4ef7 Fixed refs #23987 test on Oracle. 2014-12-15 18:15:55 -05:00
Markus Holtermann 3ef50a772b Fixed reverse test execution for migration manager tests
Thanks to Tim Graham for reporting the issue; refs #23822
2014-12-15 17:54:40 -05:00
Andriy Sokolovskiy d8f3b86a76 Fixed #23405 -- Fixed makemigrations prompt when adding Text/CharField.
A default is no longer required.
2014-12-15 14:41:52 -05:00
Andriy Sokolovskiy 089047331d Fixed #23987 -- Made SQLite SchemaEditor always use effective_default(). 2014-12-15 13:40:24 -05:00
Diego Guimarães 222699d224 Refs #23947 -- Fixed queries test execution order dependency.
Specify an id to avoid conflict with objects created in setUpTestData.
2014-12-15 12:25:55 -05:00
Tim Graham e8223b889a Corrected test assertion from refs #21403. 2014-12-15 12:04:07 -05:00
Diego Guimarães d8182f294a Refs #23947 -- Fixed admin_views test execution order dependency. 2014-12-15 10:48:42 -05:00
Markus Holtermann aa5ef0d4fc Fixed #23822 -- Added support for serializing model managers in migration
Thanks to Shai Berger, Loïc Bistuer, Simon Charette, Andrew Godwin,
Tim Graham, Carl Meyer, and others for their review and input.
2014-12-15 08:34:15 -05:00
Aymeric Augustin 71a559e771 Removed obsolete code for running test_loaders.py.
Running this file as a standalone script doesn't work anyway.
2014-12-13 22:51:57 +01:00
Michael Hall 895dc880eb Fixed #23812 -- Changed django.utils.six.moves.xrange imports to range 2014-12-13 12:45:58 -05:00