Commit Graph

5103 Commits

Author SHA1 Message Date
Michael Manfre 3ffeb93186 Ensure cursors are closed when no longer needed.
This commit touchs various parts of the code base and test framework. Any
found usage of opening a cursor for the sake of initializing a connection
has been replaced with 'ensure_connection()'.
2014-02-02 12:47:21 -05:00
Michael Manfre 0837eacc4e Made SQLCompiler.execute_sql(result_type) more explicit.
Updated SQLUpdateCompiler.execute_sql to match the behavior described in
the docstring; the 'first non-empty query' will now include all queries,
not just the main and first related update.

Added CURSOR and NO_RESULTS result_type constants to make the usages more
self documenting and allow execute_sql to explicitly close the cursor when
it is no longer needed.
2014-02-02 12:47:06 -05:00
Aymeric Augustin 4a488c1483 Silenced a spurious warning.
Thanks Timo for the report. Regression from 2f65b8e1. Refs #21794.
2014-02-01 19:42:41 +01:00
Tim Graham a938fff030 Updated some tests to use the check framework and silenced a PendingDeprecationWarning. 2014-01-31 12:52:22 -05:00
Shai Berger e9d12bae1e Made Oracle introspect FloatFields correctly
Broke InspectDBTestCase.test_field_types in two:
- a test_number_field_types, which now passes on Oracle too
- a test_field_types, for all non-numeric fields, which is still expected to fail

Also made some pep8 fixes in the tests file. Refs #19884

Thanks Tim Graham for review.
2014-01-30 00:41:11 +02:00
Anssi Kääriäinen 8b2c1ac06d Added tests for m2m queries with custom pk on the end models
It seems this case was fixed somewhere between 1.5.x and 1.6.x. I added
tests as I wasn't able to find any tests for these cases. Refs #21879
2014-01-28 21:39:15 +02:00
Tim Graham 2b6914049a Fixed #21849 -- Included the count of silenced system checks in output. 2014-01-28 08:31:02 -05:00
Loic Bistuer 3e4dc5ecf2 Fixed #21853 -- Fixed Manager.__module__ to properly return 'django.db.models.manager'.
The combination of BaseManager.from_queryset() and RenameMethodsBase results in
Manager.__module__ having the wrong value. This can be an issue when trying to
pickle the Manager class.
2014-01-28 08:17:01 -05:00
Carl Meyer 88a2d39159 Fixed #21874 -- Require Django applications to have a filesystem path.
Wherever possible this filesystem path is derived automatically from the app
module's ``__path__`` and ``__file__`` attributes (this avoids any
backwards-compatibility problems).

AppConfig allows specifying an app's filesystem location explicitly, which
overrides all autodetection based on ``__path__`` and ``__file__``. This
permits Django to support any type of module as an app (namespace packages,
fake modules, modules loaded by other hypothetical non-filesystem module
loaders), as long as the app is configured with an explicit filesystem path.

Thanks Aymeric for review and discussion.
2014-01-27 15:34:22 -07:00
Aymeric Augustin b87bc461c8 Removed TransRealMixin.
Fixed #21688. Refs https://github.com/django/django/pull/1147.
2014-01-27 22:02:07 +01:00
Aymeric Augustin b951a7fbc1 Removed superfluous uses of TransRealMixin.
The translation.override context manager cleans up after itself. As a
consequence this mixin isn't needed any more in many cases.
2014-01-27 22:01:22 +01:00
Simon Charette 10e3faf191 Fixed #19774 -- Deprecated the contenttypes.generic module.
It contained models, forms and admin objects causing undesirable
import side effects. Refs #16368.

Thanks to Ramiro, Carl and Loïc for the review.
2014-01-26 14:42:30 -05:00
Simon Charette c3881944e8 Fixed some missing/extraneous new line warnings. 2014-01-26 14:32:01 -05:00
Aymeric Augustin 3c47786cb9 Fixed #21702 -- get_model('app_label.ModelName').
Also added tests for get_model.
2014-01-26 13:01:09 +01:00
Carl Meyer ca95f8e435 Moved sys.path-extending decorator to django.test.utils and used throughout test suite.
Thanks Aymeric for the suggestion.
2014-01-25 22:50:40 -07:00
Carl Meyer 966b186981 Fixed #17304 -- Allow single-path and configured-path namespace packages as apps.
Also document the conditions under which a namespace package may or may not be
a Django app, and raise a clearer error message in those cases where it may not
be.

Thanks Aymeric for review and consultation.
2014-01-25 19:37:05 -07:00
Simon Charette 3acdb3068a Fixed a failing schema assertion.
BooleanFields are stored as TINYINT(1) on MySQL.
2014-01-25 10:59:38 -05:00
Jannis Leidel b9e0ea3cb4 Merge pull request #2211 from carljm/t21867
Fixed #21867 -- Removed AppStaticStorage; app paths are now AppConfig's job.
2014-01-25 03:57:29 -08:00
Aymeric Augustin 2ff93e027c Fixed #21829 -- Added default AppConfigs.
Thanks Russell for the report, Marc for the initial patch, Carl for the
final review, and everyone who contributed to the design discussion.
2014-01-25 10:41:56 +01:00
Carl Meyer 29ddae7436 Fixed #21871 -- Fixed Apps.is_installed() for apps with custom label.
Thanks Aymeric for design discussion.
2014-01-24 20:07:14 -07:00
Andrew Godwin 2a30b39f40 Fixed #21783: More SQLite default fun with nulls. 2014-01-25 00:10:25 +00:00
Carl Meyer f56c88a8ee Fixed #21867 -- Removed AppStaticStorage; app paths are now AppConfig's job.
AppStaticStorage only provided one thing over FileSystemStorage, which was
taking an app name (import path) and translating it into a filesystem
path. This is now something that should be done via app_config.path instead,
leaving AppStaticStorage with no reason for existence. It should be safe to
remove, as it was undocumented internal API.

There was some kind of feature in the AppDirectoriesFinder code related to a
"prefix" attribute on the storage class used by AppDirectoriesFinder. Since
this feature was undocumented, untested, and of unclear purpose, I removed it
as well.
2014-01-24 15:32:03 -07:00
Arne Brodowski 06bd181f97 Fixed typo in error message. 2014-01-24 17:40:43 +01:00
Arne Brodowski 38be3cf5e4 Fixed #21870 -- Admin check for list_editable_item
During the admin check for list_editable _check_list_editable_item
should return an empty list if all checks pass. Additionally the
Testcase test_readonly_and_editable was changed to test what the
name implies instead of duplicating the logic of test_readonly.
2014-01-24 17:40:24 +01:00
Anssi Kääriäinen 78a2617703 Fixed #21787 -- regression in MTI .exclude() queries 2014-01-24 10:10:17 +02:00
Alex Gaynor 2ba09c000d Added some missing whitespace around arithmetic operators 2014-01-22 09:21:05 -06:00
Loic Bistuer c3fdeb28ff Fixed #21846 -- Made NestedObjects handle related_name with %(app_label)s or %(class)s. 2014-01-22 09:13:15 -05:00
Markus Holtermann 047394f79c Fixed #21852 -- Make migration writer serialize iterators 2014-01-22 09:21:54 +01:00
Alex Gaynor 8482ab6633 Removed some stray newlines which caused flake8 issues 2014-01-20 22:58:05 -06:00
Carl Meyer fb862c875e Fix a check_framework test so it doesn't fail when TEST_RUNNER is set (e.g. on CI). 2014-01-20 21:08:02 -07:00
Carl Meyer 6070a5d6a6 Fixes #21833 -- Fix UserSettingsHolder.is_overridden() and add tests. 2014-01-20 20:25:33 -07:00
Jannis Leidel 8efd20f96d Added ManifestStaticFilesStorage to staticfiles contrib app.
It uses a static manifest file that is created when running
collectstatic in the JSON format.
2014-01-20 19:32:07 +01:00
Alex Gaynor ee25ea0daf Removed a stray new line which upset flake8 2014-01-20 09:57:35 -06:00
Russell Keith-Magee 53aa6c6ac1 Added warning silencers to some noisy tests.
These warnings all emerged as the result of the introduction of the checks framework.

Thanks to Anssi Kääriäinen for the report.
2014-01-20 20:30:29 +08:00
Shai Berger 056be4358d Fixed two test failures under Oracle 2014-01-20 13:01:14 +02:00
Anssi Kääriäinen 980eda0190 Fixed custom_lookups tests for Oracle
Refs #21821
2014-01-20 10:52:58 +02:00
Russell Keith-Magee a029efca44 Removed an inactive system check for upload_to.
Thanks to Simon Charette for the eagle eyes.
2014-01-20 12:31:35 +08:00
Alex Gaynor be8173af51 Fixed a small collection of flake8 violations that had snuck in 2014-01-19 21:15:31 -06:00
Russell Keith-Magee d818e0c9b2 Fixed #16905 -- Added extensible checks (nee validation) framework
This is the result of Christopher Medrela's 2013 Summer of Code project.

Thanks also to Preston Holmes, Tim Graham, Anssi Kääriäinen, Florian
Apolloner, and Alex Gaynor for review notes along the way.

Also: Fixes #8579, fixes #3055, fixes #19844.
2014-01-20 10:45:21 +08:00
Andrew Godwin 51832c8aec Remove other unicode literal 2014-01-19 18:57:59 +00:00
Andrew Godwin b1fc8c19b2 Remove unicode prefix that snuck in 2014-01-19 18:57:06 +00:00
Andrew Godwin a68f325791 Fixed #21638: Validators are now comparable, stops infinite user mig'ns 2014-01-19 18:56:16 +00:00
Andrew Godwin 3f1a008266 Fixed #21664: Multi-table inheritance was duplicating _ptr fields 2014-01-19 18:35:49 +00:00
Andrew Godwin af4a8478e4 Fixed #21783: (again) Found second source of bug, also squashed it. 2014-01-19 17:43:31 +00:00
Andrew Godwin e8d4aed3b9 Merge pull request #1681 from loic/migrations.format
Fixed #21323 -- Improved readability of serialized Operation.
2014-01-19 09:30:27 -08:00
Loic Bistuer 374faa4721 Fixed #21323 -- Improved readability of serialized Operation. 2014-01-20 00:16:07 +07:00
Andrew Godwin e802c97581 Fixed #21783: Use defaults for adding NOT NULL on sqlite 2014-01-19 17:10:24 +00:00
Andrew Godwin c9de1b4a55 Implement swappable model support for migrations 2014-01-19 16:43:12 +00:00
Alex Gaynor 9d487ae2a1 Refs #21628 -- removed one usage of the imp module in the tests. It is deprecated in Python 3.4 2014-01-19 00:58:22 -06:00
Aymeric Augustin 74d8fdcfa6 Stopped assuming that INSTALLED_APPS only contains app names.
While this assumption is true for the time being, it makes the code
needlessly brittle.
2014-01-18 23:06:00 +01:00