Commit Graph

10155 Commits

Author SHA1 Message Date
Tim Graham da5eb3d56c Refs #28370 -- Removed support for the context arg of Field.from_db_value() and Expression.convert_value().
Per deprecation timeline.
2019-01-17 10:52:19 -05:00
Tim Graham 8045dff98c Refs #27829 -- Removed settings.DEFAULT_CONTENT_TYPE per deprecation timeline. 2019-01-17 10:50:25 -05:00
Tim Graham 573ec714e5 Refs #25978 -- Removed shortcuts.render_to_response() per deprecation timeline. 2019-01-17 10:50:25 -05:00
Simon Charette f84ad16ba4 Refs #17198 -- Detected existing total ordering in admin changelist.
Appending pk is not necessary when a subset of the ordering expressions is
contained in a non-nullable unique contraint.

Related field ordering through lookups and related ordering introspection is
omitted for simplicitly purpose.
2019-01-17 16:22:14 +01:00
Simon Charette 9e5e5a657b Fixed #30044 -- Raised a FieldError on inherited field update attempts. 2019-01-16 14:09:51 -05:00
Santiago Basulto 4fc35a9c3e Fixed #20147 -- Added HttpRequest.headers. 2019-01-16 13:38:47 -05:00
Simon Charette aa5d0a5a90 Removed unnecessary transaction wrapping in expressions test. 2019-01-16 13:23:55 -05:00
Arthur Rio 181fb60159 Fixed #11154, #22270 -- Made proxy model permissions use correct content type.
Co-Authored-By: Simon Charette <charette.s@gmail.com>
Co-Authored-By: Antoine Catton <acatton@fusionbox.com>
2019-01-16 10:07:28 -05:00
Collin Anderson 769355c765 Fixed #9475 -- Allowed RelatedManager.add(), create(), etc. for m2m with a through model. 2019-01-15 11:12:17 -05:00
Nasir Hussain f021c110d0 Fixed #30099 -- Fixed invalid SQL when filtering a Subquery by an aggregate. 2019-01-15 07:22:59 -05:00
Mariusz Felisiak 1508e71c5b Relaxed assertions to fix GIS test failures on Oracle 18c. 2019-01-14 18:32:42 -05:00
Simon Charette b181aba7dd Refs #28478 -- Prevented database feature based skipping on tests disallowing queries.
Database features may require a connection to be established to determine
whether or not they are enabled.
2019-01-14 16:16:30 -05:00
Simon Charette f5b635086a Refs #28478 -- Prevented connection attempts against disallowed databases in tests.
Mocking connect as well as cursor methods makes sure an appropriate error
message is surfaced when running a subset of test attempting to access a
a disallowed database.
2019-01-14 16:05:00 -05:00
Nick Pope 6d4efa8e6a Refs #28643 -- Changed Variance() to use NumericOutputFieldMixin.
Keeps precision instead of forcing DecimalField to FloatField.
2019-01-14 14:39:46 -05:00
Nick Pope e85afa5943 Refs #28643 -- Changed StdDev() to use NumericOutputFieldMixin.
Keeps precision instead of forcing DecimalField to FloatField.
2019-01-14 14:38:00 -05:00
Nick Pope c690afb873 Refs #28643 -- Changed Avg() to use NumericOutputFieldMixin.
Keeps precision instead of forcing DecimalField to FloatField.
2019-01-14 14:35:41 -05:00
Sergey Fedoseev b86bb47818 Fixed #30093 -- Fixed ordering of combined queryset ordered by F expressions. 2019-01-14 10:28:11 -05:00
Simon Charette b2c598e30d Removed unnecessary skipUnlessDBFeature.
None of the tests interact with the database.
2019-01-13 21:48:40 -05:00
Tom Forbes c8720e7696 Fixed #27685 -- Added watchman support to the autoreloader.
Removed support for pyinotify (refs #9722).
2019-01-13 20:33:47 -05:00
Simon Charette a02a6fd580 Refs #28478 -- Prevented connection creation in model_indexes tests.
Entering a SchemaEditor instance creates a connection but it isn't needed
for this test.
2019-01-13 13:47:08 -05:00
orlnub123 573f44d62f Fixed #30057 -- Fixed diffsettings ignoring custom configured settings.
Regression in 49b679371f.
2019-01-12 11:07:03 -05:00
Nick Pope abf8e390a4 Refs #28643 -- Added Reverse database function.
Thanks Mariusz Felisiak for Oracle advice and review.
2019-01-12 10:45:48 -05:00
Paveł Tyślacki b69f8eb04c Fixed #30062 -- Added support for unique conditional constraints. 2019-01-12 09:50:20 -05:00
Paveł Tyślacki f4c0c0b0aa Added tests for Check/UniqueConstraint.__eq__(). 2019-01-12 09:24:22 -05:00
can e192223ed9 Fixed #29738 -- Allowed serializing psycopg2 range types in migrations. 2019-01-11 19:32:26 -05:00
can 7d3b3897c1 Refs #29738 -- Allowed registering serializers with MigrationWriter. 2019-01-11 18:13:16 -05:00
MaximZemskov 3c01fe30f3 Fixed #30097 -- Made 'obj' arg of InlineModelAdmin.has_add_permission() optional.
Restored backwards compatibility after refs #27991.
Regression in be6ca89396.
2019-01-11 18:02:43 -05:00
Tim Graham 8f4eee1777
Moved django.db.migrations.writer.SettingsReference to django.conf.
Reduces the possibility of circular imports.
2019-01-11 15:28:22 -05:00
Sanyam Khurana 76d31be2d0 Refs #23829 -- Made ping_google command/function use https for the sitemap URL. 2019-01-11 10:32:22 -05:00
Simon Charette 41e73de39d Fixed #28478 -- Make DiscoverRunner skip creating unused test databases.
SimpleTestCase.databases makes it possible to determine the set of
databases required to run the discovered tests.
2019-01-10 19:11:21 -05:00
Simon Charette 8c775391b7 Refs #28478 -- Deprecated TestCase's allow_database_queries and multi_db in favor of databases. 2019-01-10 19:11:21 -05:00
Paveł Tyślacki 647be06538 Renamed variables after generalization of constraints.
Follow up to 8eae094638.
2019-01-10 18:54:41 -05:00
Mads Jensen 4b9d72210f Refs #28643 -- Added NullIf database function.
Thanks Nick Pope, Mariusz Felisiak, and Tim Graham for reviews.
2019-01-10 12:10:12 -05:00
Joshua Cannon db1b10ef0d Fixed #30037 -- Added request arg to RemoteUserBackend.configure_user(). 2019-01-09 20:01:04 -05:00
Simon Charette bc05547cd8 Fixed #28658 -- Added DISTINCT handling to the Aggregate class. 2019-01-09 17:52:36 -05:00
Benjy Weinberger 222caab68a Fixed #30071 -- Fixed error message when a 'default' database isn't provided. 2019-01-09 10:58:37 -05:00
Benjy Weinberger c2c85663e2 Fixed #30087 -- Tested error handling for empty 'default' database. 2019-01-09 10:58:25 -05:00
Nick Pope a35d2a4510 Refs #23748 -- Added AutoField introspection for SQLite. 2019-01-09 09:59:15 -05:00
Tom Hacohen 1ecc0a395b Fixed #30070, CVE-2019-3498 -- Fixed content spoofing possiblity in the default 404 page.
Co-Authored-By: Tim Graham <timograham@gmail.com>
2019-01-03 21:21:55 -05:00
Mariusz Felisiak e49ab72637
Refs #29851 -- Fixed test_subquery_row_range_rank() crash on MariaDB 10.2+.
Thanks Tom Forbes for the report.
2019-01-03 20:18:45 +01:00
Tim Graham b5fe97a34e Added __init__.py for db_utils tests. 2019-01-02 18:19:45 -05:00
Tim Graham 0004daa536
Used 4 space hanging indent for dictionaries.
Thanks Mariusz Felisiak for auditing.
2019-01-02 18:18:19 -05:00
Tim Graham e4a714b259 Pinned Pillow != 5.4.0 in test requirements.
There's a bug that causes a test failure in forms_tests:
https://github.com/python-pillow/Pillow/pull/3501/files#r244651761.
2019-01-02 17:15:39 -05:00
Patrik Sletmo 14e2b1b065 Fixed #29981 -- Fixed inline formsets with a OnetoOneField primary key that uses to_field. 2019-01-01 10:40:22 -05:00
Tim Graham 02c07be95c Fixed #30050 -- Fixed InlineModelAdmin.has_change_permission() called with non-None obj during add.
Thanks andreage for the report and suggested fix.
2019-01-01 09:42:14 -05:00
Paveł Tyślacki 0123b67f6b Fixed #30060 -- Moved SQL generation for indexes and constraints to SchemaEditor. 2019-01-01 09:39:58 -05:00
Tim Graham 043bd70942 Updated test URL patterns to use path() and re_path(). 2018-12-31 10:47:32 -05:00
Tim Graham 1136d57f01
Updated a test to reflect the fact that "import *" isn't used in URLconfs anymore (refs #14675). 2018-12-31 10:24:28 -05:00
Matt Wiens e817ae74da Followed style guide for model attribute ordering. 2018-12-27 19:34:14 -05:00
Mariusz Felisiak dd8ed64113
Fixed #29851 -- Fixed crash of annotations with window expressions in Subquery. 2018-12-27 20:21:57 +01:00
Jon Dufresne 6fe9c45b72 Fixed #30024 -- Made urlencode() and Client raise TypeError when None is passed as data. 2018-12-27 11:19:55 -05:00
CHI Cheng b7dbd5ff68 Fixed broken links to PyYAML page. 2018-12-27 10:48:37 +01:00
Denis Stebunov 277de22984 Fixed #30058 -- Made SMTP EmailBackend.send_messages() return 0 for empty/error cases. 2018-12-26 13:33:08 -05:00
Tim Graham 0b54ab0675 Refs #30033 -- Fixed schema's test_m2m_rename_field_in_target_model test failure on SQLite < 3.20.
Mixing local test models with non-local models resulted in a referential
integrity error during tear down since the models are removed in separate
schema editor instances which each check constraints.

Failure appeared after 7289874adc.
2018-12-26 11:26:51 -05:00
Tim Graham b74b6736d0
Refs #29547 -- Skipped an unsupported partial index test on older versions of SQLite.
Follow up to e5b8626c0e.
2018-12-26 11:20:11 -05:00
Simon Charette 64f9776bc4 Refs #29004 -- Prevented inspectdb tests from flushing all tables data.
This is a costly operation on most database backends.
2018-12-24 15:32:39 -05:00
Simon Charette f6d8b0c47e Refs #26840 -- Corrected SQLite connection mocking in a setup_databases() test.
The test was expecting connections used by DiscoverRunner.setup_databases()
to be the ones defined in django.test.runner but this doesn't hold true
since this method was made a proxy of django.test.utils.setup_databases.

This broke the TransactionTestCase.serialized_rollback feature in the test
suite because calls to create_db_test() cleared the test data persisted on
connections objects.

Added an assertions to prevent this from happening again.
2018-12-24 15:32:27 -05:00
Nick Pope 83677faf86 Fixed #30056 -- Added SQLite support for StdDev and Variance functions. 2018-12-24 11:14:58 -05:00
Sanyam Khurana 5d25804eaf Fixed #20098 -- Added a check for model Meta.db_table collisions. 2018-12-24 10:40:11 -05:00
Nick Pope e626a3f993 Renamed Sqlite and Sqlite3 references to SQLite. 2018-12-22 18:52:54 -05:00
Nick Pope 7534e43497 Refs #14204 -- Removed obsolete referential integrity comment for SQLite. 2018-12-22 18:44:21 -05:00
Sergey Fedoseev a68ea23101 Fixed #29970, #30041 -- Made ModelBase.__new__() pass attrs without contribute_to_class() to type.__new__(). 2018-12-22 18:11:24 -05:00
Simon Charette 25a0781a16 Refs #29182 -- Corrected SQLite's supports_atomic_references_rename feature flag. 2018-12-22 14:58:08 -05:00
Simon Charette e5b8626c0e Refs #29547 -- Corrected SQLite's supports_partial_indexes feature flag. 2018-12-22 14:51:59 -05:00
Simon Charette 20f6f9eaa1 Renamed SQLite3 references to to SQLite.
The version suffix isn't part of the product name.
2018-12-22 14:20:43 -05:00
François Freitag e671337e8b Fixed #29750 -- Added View.setup() hook for class-based views. 2018-12-21 19:01:11 -05:00
jtiai 5a77190e66 Fixed #29792 -- Made GeometryField.deconstruct() handle 'extent' and 'tolerance' args. 2018-12-21 17:44:45 -05:00
jtiai 7b9f8e38bb Added tests for GeometryField.deconstruct(). 2018-12-21 17:41:39 -05:00
Tim Graham 194a4b526c Added tests for ContentType/Group/Permission.__str__(). 2018-12-21 12:45:02 -05:00
Dakota Hawkins 8d3147e130 Fixed #30031 -- Added --no-header option to makemigrations/squashmigrations. 2018-12-19 12:41:31 +01:00
Konstantin Alekseev b514dc14f4 Fixed #30015 -- Ensured request body is properly consumed for keep-alive connections. 2018-12-19 11:27:08 +01:00
Simon Charette 894cb13779 Refs #29182 -- Stopped relying on legacy alter table semantic on SQLite 3.26+.
SQLite 3.26 changed the behavior of table and column renaming operations to
repoint foreign key references even if foreign key checks are disabled.

This makes the workarounds in place to simulate this behavior unnecessary on
SQLite 3.26+. Refs #30033.
2018-12-17 10:44:05 +01:00
Simon Charette 315357ad25 Fixed #30023 -- Prevented SQLite schema alterations while foreign key checks are enabled.
Prior to this change foreign key constraint references could be left pointing
at tables dropped during operations simulating unsupported table alterations
because of an unexpected failure to disable foreign key constraint checks.

SQLite3 does not allow disabling such checks while in a transaction so they
must be disabled beforehand.

Thanks ezaquarii for the report and Carlton and Tim for the review.
2018-12-15 18:51:59 -05:00
Manan 3a4558b84f Moved choices inside of test models per coding style. 2018-12-10 09:28:49 -05:00
Benjamin Wohlwend 79c196cfb2 Fixed #28766 -- Added ResolverMatch.route.
Co-Authored-By: Xavier Fernandez <xavier.fernandez@polyconseil.fr>
2018-12-06 18:05:40 -05:00
Mariusz Felisiak f9a33e3c3f Fixed #29932 -- Fixed combining compound queries with sub-compound queries on SQLite and Oracle. 2018-12-06 15:31:33 -05:00
Patrick Arminio ae180fa4b7 Fixed #29986 -- Added .format() support to ngettext_lazy strings. 2018-12-06 15:12:34 -05:00
Simon Charette 53269bcaaf Fixed #30011 -- Fixed queries that reuse filtered aggregates.
Thanks Taqi Abbas and Raphael Kimmig for the report.
2018-12-06 14:55:35 -05:00
Tim Graham 88619e6129
Bumped mysqlclient requirement to >= 1.3.13.
There are test failures with older versions.
2018-12-06 14:49:27 -05:00
Tim Graham 4c7c608a1d Reverted "Fixed #25251 -- Made data migrations available in TransactionTestCase when using --keepdb."
This reverts commits b3b1d3d45f and
9fa0d3786f due to reverse build failures
for which a solution isn't forthcoming.
2018-12-05 15:30:23 -05:00
Tim Graham 734ce71824 Refs #30013 -- Fixed SchemaEditor.quote_value() test for mysqlclient 1.3.14+. 2018-12-05 14:46:31 -05:00
François Freitag fbc7e41389 Tested exception messages in generic_views tests. 2018-12-04 22:52:19 -05:00
Carlton Gibson 8245c99ee6
Fixed #29930 -- Allowed editing in admin with view-only inlines.
Co-authored-by: Tim Graham <timograham@gmail.com>
2018-12-03 07:44:18 -08:00
Xavier Fernandez 4d9f51f2b5 Added test for ResolverMatch.__repr__(). 2018-11-30 17:43:55 -05:00
Xavier Fernandez 9d334e0a7a Removed urlpatterns_reverse dependency in urlpatterns tests. 2018-11-30 17:39:34 -05:00
Tim Fiedler b07273a0f7 Fixed #29987 -- Detected unmanaged model deletions. 2018-11-30 09:57:43 -05:00
Jaap Roes 8a1a919468 Fixed #29997 -- Allowed combining SearchQuerys with different configs.
Seems to be a needless restriction in
978a00e39f.
2018-11-30 09:42:50 -05:00
Tim Graham 41db8cb252
Used assertCountEqual() in contrib.postgres.search tests. 2018-11-29 14:43:53 -05:00
romgar 9fa0d3786f Refs #25251 -- Filtered out skipped tests when processing the test suite to set _next_serialized_rollback. 2018-11-29 11:20:27 -05:00
Basil Dubyk 7d1123e5ad Fixed #29929 -- Fixed admin view-only change form crash when using ModelAdmin.prepopulated_fields. 2018-11-28 15:40:14 -05:00
dmytryi.striletskyi dcd1025f4c Fixed #28385 -- Fixed deserializing natural keys when primary key has a default value.
Co-Authored-By: Hasan Ramezani <hasan.r67@gmail.com>
2018-11-27 18:35:19 -05:00
Tim Graham 7056a4dd8e Switched TestCase to SimpleTestCase in GIS tests. 2018-11-27 10:22:13 -05:00
Simon Charette 0f212db29d Made reused RequestFactory instances class attributes. 2018-11-27 09:49:02 -05:00
Simon Charette 7f63b894c0 Adjusted code style of a few test data setup methods.
Thanks Mariusz for suggesting it.
2018-11-27 09:48:22 -05:00
Simon Charette 84e7a9f4a7 Switched setUp() to setUpTestData() where possible in Django's tests. 2018-11-27 09:35:17 -05:00
Tim Graham 193c109327 Switched TestCase to SimpleTestCase where possible in Django's tests. 2018-11-27 08:58:44 -05:00
Mariusz Felisiak f091ea3515
Refs #29722 -- Added introspection of materialized views for Oracle.
Thanks Tim Graham for the review.
2018-11-26 19:45:05 +01:00
Simon Charette 26c2a6ff88 Removed empty setUp() in admindocs tests. 2018-11-26 10:24:01 -05:00
Simon Charette b8763fc0a4 Used SimpleTestCase for template library tests. 2018-11-26 10:23:35 -05:00
Hasan Ramezani 11a9017179 Fixed #29966 -- Added tests for BaseHandler's "The view didn't return an HttpResponse object" error. 2018-11-23 19:19:02 -05:00
Nick Pope c512912463 Refs #23801 -- Made integer field max_length warning show correct field type. 2018-11-23 14:40:46 -05:00
Claude Paroz d7e18a509e Fixed #29978 -- Catched GDALException in GeometryField.to_python 2018-11-23 09:39:02 +01:00
Tom Forbes 31408446b3 Fixed #29974 -- Fixed non-truthy primary key values for QuerySet.bulk_update(). 2018-11-21 22:58:43 -05:00
Tim Graham 5a71bd7f9d Removed unused views in middleware_exceptions tests.
Unused since d334f46b7a.
2018-11-21 17:48:09 -05:00
Mariusz Felisiak d5f4ce9849
Fixed #29949 -- Refactored db introspection identifier converters.
Removed DatabaseIntrospection.table_name_converter()/column_name_converter()
and use instead DatabaseIntrospection.identifier_converter().

Removed DatabaseFeatures.uppercases_column_names.

Thanks Tim Graham for the initial patch and review and Simon Charette
for the review.
2018-11-21 09:06:50 +01:00
redodo 2e4776196d Fixed #29953 -- Added CSS class to column headers in tabular inlines.
The class name is the same as one given to the fields in the change list.
2018-11-20 18:17:53 -05:00
Sanyam Khurana a7d6cab771 Fixed #29282 -- Prevented some admin checks from crashing with TypeError.
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2018-11-20 17:19:13 -05:00
Tim Graham ced0bdd923 Tested a middleware's process_template_response() returning None. 2018-11-20 11:35:01 -05:00
redodo 89a2216486 Fixed #29961 -- Made RelatedFieldWidgetWrapper hide related item links if wrapping a hidden widget. 2018-11-19 15:12:52 -05:00
Nick Pope ebd270627c Refs #29722 -- Added introspection of partitions for PostgreSQL. 2018-11-19 14:06:01 -05:00
Thomas Grainger 0607699902 Fixed #29478 -- Added support for mangled names to cached_property.
Co-Authored-By: Sergey Fedoseev <fedoseev.sergey@gmail.com>
2018-11-19 13:40:49 -05:00
Sergey Fedoseev 80ba7a881f Fixed cached_properties that share a common property.
The aliases aren't cached and thus the old usage will be an error after
refs #29478.
2018-11-19 08:59:46 -05:00
Tim Graham 9cac10eee4 Added BaseDatabaseSchemaEditor._effective_default() to allow testing without a connection. 2018-11-17 19:27:53 -05:00
Tim Graham e62f6e0968 Fixed #29505 -- Removed SchemaEditor's calling of callable defaults.
Thanks Eugene Pakhomov for the suggested fix.
2018-11-17 19:27:53 -05:00
Hasan Ramezani ec16588c27 Added test for Model._check_column_name_clashes(). 2018-11-17 15:24:48 -05:00
Tim Graham 405ec5b9c6 Fixed typo in tests/admin_views/tests.py. 2018-11-16 15:09:22 -05:00
Mathew Payne 26bb2611a5 Fixed #29952 -- Lowercased all passwords in contrib.auth's auth/common-passwords.txt.gz. 2018-11-15 14:11:03 -05:00
Hasan Ramezani cf915cb513 Added a test for a lookup in Model.refresh_from_db(fields=[...]). 2018-11-15 11:38:47 -05:00
Ian Foote e1fc07c047 Fixed #17930 -- Allowed ORing (|) with sliced QuerySets. 2018-11-15 09:43:58 -05:00
Sarah Guermond cd40306854 Fixed #25884 -- Fixed migrate --run-syncdb when specifying an app label. 2018-11-14 18:22:59 -05:00
Hasan Ramezani 6d4e5feb79 Fixed #29835 -- Made RelatedFieldListFilter respect ModelAdmin.ordering. 2018-11-14 14:29:39 -05:00
Basil Dubyk 35a08b8541 Fixed #17210 -- Made NullBooleanSelect use unknown/true/false as query data. 2018-11-14 13:43:34 -05:00
Mariusz Felisiak ff8020ed49 Fixed #29788 -- Added support for Oracle Managed File (OMF) tablespaces. 2018-11-13 18:22:41 -05:00
Simon Charette db13bca60a Fixed #29641 -- Added support for unique constraints in Meta.constraints.
This constraint is similar to Meta.unique_together but also allows
specifying a name.

Co-authored-by: Ian Foote <python@ian.feete.org>
2018-11-13 17:57:27 -05:00
oliver d0af5de122 Moved duplicate author declarations to setUpTestData() in DeleteViewTests. 2018-11-13 17:27:24 -05:00
Simon Charette dba4a634ba Refs #29641 -- Refactored database schema constraint creation.
Added a test for constraint names in the database.

Updated SQLite introspection to use sqlparse to allow reading the
constraint name for table check and unique constraints.

Co-authored-by: Ian Foote <python@ian.feete.org>
2018-11-13 15:25:44 -05:00
Simon Charette 2f120ac517 Fixed #29945 -- Moved contrib.postgres uninstallation logic to the app config. 2018-11-12 11:15:48 -05:00
Hasan Ramezani c7cc7526d5 Completed test coverage of contrib.humanize.templatetags.humanize. 2018-11-10 19:09:37 -05:00
Florian Apolloner 934acf1126 Fixed keep-alive support in manage.py runserver.
Ticket #25619 changed the default protocol to HTTP/1.1 but did not
properly implement keep-alive. As a "fix" keep-alive was disabled in
ticket #28440 to prevent clients from hanging (they expect the server to
send more data if the connection is not closed and there is no content
length set).

The combination of those two fixes resulted in yet another problem:
HTTP/1.1 by default allows a client to assume that keep-alive is
supported unless the server disables it via 'Connection: close' -- see
RFC2616 8.1.2.1 for details on persistent connection negotiation. Now if
the client receives a response from Django without 'Connection: close'
and immediately sends a new request (on the same tcp connection) before
our server closes the tcp connection, it will error out at some point
because the connection does get closed a few milli seconds later.

This patch fixes the mentioned issues by always sending 'Connection:
close' if we cannot determine a content length. The code is inefficient
in the sense that it does not allow for persistent connections when
chunked responses are used, but that should not really cause any
problems (Django does not generate those) and it only affects the
development server anyways.

Refs #25619, #28440.
2018-11-10 13:54:45 +01:00
Tim Graham f82be9ebc7
Fixed #29934 -- Added sqlparse as a require dependency. 2018-11-09 19:09:36 -05:00
Matthias Kestenholz f9ff1df1da Fixed #29917 -- Stopped collecting ModelAdmin.actions from base ModelAdmins. 2018-11-09 18:52:30 -05:00
Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి) a7ef4a56e0 Fixed #29920 -- Added a test for smart_urlquote()'s UnicodeError branch. 2018-11-09 12:39:08 -05:00
oliver 9b110f0a84 Moved duplicate author declarations to setUpTestData() in UpdateViewTests. 2018-11-09 15:26:52 +01:00
Simon Charette 75dfa92a05 Fixed #29908 -- Fixed setting of foreign key after related set access if ForeignKey uses to_field.
Adjusted known related objects handling of target fields which relies on
from and to_fields and has the side effect of fixing a bug bug causing
N+1 queries when using reverse foreign objects.

Thanks Carsten Fuchs for the report.
2018-11-08 19:51:15 -05:00
oliver 0ce2ad9ca4 Used QuerySet.bulk_create() in a couple tests. 2018-11-06 19:32:40 -05:00
romgar b3b1d3d45f Fixed #25251 -- Made data migrations available in TransactionTestCase when using --keepdb.
Data loaded in migrations were restored at the beginning of each
TransactionTestCase and all the tables are truncated at the end of
these test cases. If there was a TransactionTestCase at the end of
the test suite, the migrated data weren't restored in the database
(especially unexpected when using --keepdb). Now data is restored
at the end of each TransactionTestCase.
2018-11-06 16:57:50 -05:00
Tom Forbes ecac6d7a2a Improved performance of runtests.py with os.scandir(). 2018-11-04 18:56:46 -05:00
Hasan Ramezani 6b7f1c2530 Increased test coverage of django.utils.http. 2018-11-03 11:13:28 -04:00
Tom Forbes d207ac1568 Fixed #29883 -- Added selenium hub support to runtests.py. 2018-11-03 09:56:14 -04:00
Jayantha Gumballi dfcdc8992f Fixed #29886 -- Fixed unaccent lookup when PostgreSQL's standard_conforming_strings option is off.
Thanks Tom McClure for the patch.
2018-11-01 11:14:34 -04:00
Tim Graham 98ef3829e9 Fixed #29890 -- Fixed FileSystemStorage crash if concurrent saves try to create the same directory.
Regression in 632c4ffd9c.
2018-10-31 19:28:11 -04:00
Javier Matos Odut 3d4d0a25b2 Fixed #29901 -- Allowed overriding an autocomplete/raw_id_fields/radio_fields widget with ModelAdmin.get_formset(). 2018-10-31 10:16:17 -04:00
Junyoung df448bfd02 Fixed #29783 -- Added app label validation to showmigrations command. 2018-10-30 19:29:00 -04:00
Artur Juraszek 817c6cdf0e Capitalized SecurityMiddleware headers for consistency with other headers.
(No behavior change since HTTP headers are case insensitive.)
2018-10-30 18:30:51 -04:00
Hasan Ramezani c1c68d1ac0 Increased test coverage of django/views/generic/dates.py. 2018-10-30 14:27:48 -04:00
Jayden Kneller 916aecd29d Fixed #29866 -- Made DiscoverRunner do tests tear down if running checks or tests raises an exception. 2018-10-30 12:01:48 -04:00
Simon Charette 630f3d8b46
Refs #29868 -- Prevented name collisions between test constraints on Oracle. 2018-10-30 09:26:03 -04:00
Mads Jensen a906c98982 Fixed #29547 -- Added support for partial indexes.
Thanks to Ian Foote, Mariusz Felisiak, Simon Charettes, and
Markus Holtermann for comments and feedback.
2018-10-29 19:34:54 -04:00
Hasan Ramezani 4f8f1b2f24 Fixed #29903 -- Added error message for invalid WeekArchiveView week_format. 2018-10-29 14:22:42 -04:00
Simon Charette d8e03fdeb9 Fixed #29897 -- Fixed autodetector's swappable MTI dependency resolution.
Thanks Steven Ganz for the detailed report.
2018-10-29 11:24:30 -04:00
Simon Charette 95bda03f2d Fixed #29868 -- Retained database constraints on SQLite table rebuilds.
Refs #11964.

Thanks Scott Stevens for testing this upcoming feature and the report.
2018-10-29 10:33:41 +01:00
Tim Graham f77fc56c96
Fixed #29896 -- Fixed incorrect Model.save() cache relation clearing for foreign keys that use to_field.
Regression in ee49306176.
2018-10-28 22:54:02 -04:00
Hasan Ramezani 4c13b90702 Added test coverage for views.generic.dates.MonthMixin.get_month() KeyError branch. 2018-10-27 18:37:44 -04:00
Tim Graham f892781b95 Fixed #28606 -- Deprecated CachedStaticFilesStorage. 2018-10-27 11:58:29 -04:00
Hasan Ramezani 55b0b766fb Completed test coverage of views.defaults.bad_request(). 2018-10-25 20:03:58 -04:00
Mariusz Felisiak c6525bea9e Fixed #29534 -- Made dbshell use rlwrap on Oracle if available. 2018-10-25 19:39:42 -04:00
Sergey Fedoseev 9a88c6dd6a Fixed #29827 -- Fixed reuse of test databases with --keepdb on MySQL.
Regression in e1253bc26f.
2018-10-25 19:37:41 -04:00
Sanyam Khurana 83c7096f2a Fixed #29869 -- Made UUIDField.to_python() convert integers. 2018-10-24 20:26:57 -04:00
Sanyam Khurana c86a3d80a2 Fixed #29721 -- Ensured migrations are applied and recorded atomically. 2018-10-24 19:29:11 -04:00
Simon Charette 32da3cfdf9 Refs #11964 -- Removed raw SQL from and cleaned up constraint operation tests. 2018-10-24 19:18:41 -04:00
Tom Forbes 8f90593e6f Removed obsolete and flaky GeoIP tests. 2018-10-23 20:46:49 -04:00
Hasan Ramezani 6a8b57df6a Completed test coverage of views.static.directory_name(). 2018-10-23 20:44:27 -04:00
Prabakaran Kumaresshan 10d82c85aa Fixed #29831 -- Added validation for makemigrations --name. 2018-10-23 10:05:24 -04:00
jannschu efc0f77f02 Fixed #29830 -- Fixed loss of custom utf-8 body encoding in mails. 2018-10-22 15:21:33 -04:00
buzzi 24cae0bedc Fixed #29860 -- Allowed BaseValidator to accept a callable limit_value. 2018-10-22 10:26:54 -04:00
Simon Charette 5e3463f6bc Fixed #27595 -- Made ForeignKey.get_col() follow target chains.
Previously, foreign relationships were followed only one level deep which
prevents foreign keys to foreign keys from being resolved appropriately.
This was causing issues such as improper database value conversion for
UUIDField on SQLite because the resolved expression's output field's
internal type wasn't correct. Added tests to make sure unlikely foreign
reference cycles don't cause recursion errors.

Refs #24343.

Thanks oyooyo for the report and Wayne Merry for the investigation.
2018-10-22 09:49:34 -04:00
Florian Apolloner c53af56613 Fixed #29847 -- Ensured proper ordering in queries.
Even though good databases tend to keep the result sorted by the/one
window expression and the planners are smart enough to not resort if not
required, it is not valid to rely on this.

MariaDB specifically did return whatever order it wanted, which is
completely okay. Now we sort towards the expected data for all databases.
2018-10-21 22:05:06 +02:00
Florian Apolloner e127ef62de Fixed a failing test when the source directory is on a readonly fs. 2018-10-21 19:37:58 +02:00
Mariusz Felisiak 328f5627dd
Fixed #29870 -- Added DurationField introspection for Oracle and PostgreSQL.
Thanks Tim Graham for the review.
2018-10-21 09:08:05 +02:00
aspalding dc5e75d419 Fixed #29838 -- Fixed crash when combining Q objects with __in lookups and lists.
Regression in fc6528b25a.
2018-10-17 11:34:49 -04:00
aspalding 217f82d713 Refs #29838 -- Fixed make_hashable() for values that have lists or dicts nested in tuples.
And for non-hashable values that are iterable, e.g. sets.
2018-10-17 11:17:50 -04:00
aspalding 834c4ec8e4 Moved make_hashable() to django.utils and added tests. 2018-10-17 11:17:23 -04:00
Florian Apolloner bc7dd8490b Fixed #21171 -- Avoided starting a transaction when a single (or atomic queries) are executed.
Checked the following locations:

 * Model.save(): If there are parents involved, take the safe way and use
   transactions since this should be an all or nothing operation.

   If the model has no parents:

    * Signals are executed before and after the previous existing
      transaction -- they were never been part of the transaction.

    * if `force_insert` is set then only one query is executed -> atomic
      by definition and no transaction needed.

    * same applies to `force_update`.

    * If a primary key is set and no `force_*` is set Django will try an
      UPDATE and if that returns zero rows it tries an INSERT. The first
      case is completly save (single query). In the second case a
      transaction should not produce different results since the update
      query is basically a no-op then (might miss something though).

 * QuerySet.update(): no signals issued, single query -> no transaction
   needed.

 * Model/Collector.delete(): This one is fun due to the fact that is
   does many things at once.

   Most importantly though: It does send signals as part of the
   transaction, so for maximum backwards compatibility we need to be
   conservative.

   To ensure maximum compatibility the transaction here is removed only
   if the following holds true:

     * A single instance is being deleted.
     * There are no signal handlers attached to that instance.
     * There are no deletions/updates to cascade.
     * There are no parents which also need deletion.
2018-10-17 12:19:02 +02:00
Mads Jensen 1c0bf95ff6 Refs #23919 -- Removed a stray object-inheritance.
Follow up to 081e787160.
2018-10-16 09:58:53 -04:00
Jon Dufresne 0cd465b63a Fixed #29817 -- Deprecated settings.FILE_CHARSET. 2018-10-15 17:15:41 -04:00
Jon Dufresne 99d4fc18bd Refs #27829 -- Added warning for settings.DEFAULT_CONTENT_TYPE usage outside of Django. 2018-10-15 16:31:39 -04:00
oliver 1299421cad Fixed #29725 -- Removed unnecessary join in QuerySet.count() and exists() on a many-to-many relation. 2018-10-15 11:01:57 -04:00
Mariusz Felisiak f2e2a1bd4b
Fixed #29845 -- Fixed Cast crash on MySQL when casting to DecimalField. 2018-10-15 15:57:22 +02:00
Tim Graham 70a80ff1be Added a urlize test for wrapping characters. 2018-10-12 08:13:52 +02:00
Patrik Sletmo adfdb9f169 Fixed #29814 -- Added support for NoneType serialization in migrations. 2018-10-11 09:02:14 -04:00
Mariusz Felisiak 52fec5d18f
Fixed #29836 -- Bumped required cx_Oracle to 6.0. 2018-10-11 11:43:16 +02:00
Jon Dufresne c82893cb8c Refs #27795 -- Removed force_bytes() usage from django/utils/http.py.
django.utils.http.urlsafe_base64_encode() now returns a string, not a
bytestring. Since URLs are represented as strings,
urlsafe_base64_encode() should return a string. All uses immediately
decoded the bytestring to a string anyway.

As the inverse operation, urlsafe_base64_decode() accepts a string.
2018-10-10 14:38:22 -04:00
Hasan Ramezani b5d7604cb0 Completed FixedOffset test coverage. 2018-10-09 20:32:08 -04:00
Jon Dufresne e90af8bad4 Capitalized "Python" in docs and comments. 2018-10-09 09:26:07 -04:00
Jon Dufresne 31c0348687 Fixed postgres_tests.test_signals.OIDTests when run in isolation. 2018-10-09 09:23:36 -04:00
Eric Brandwein b0b4aac555 Fixed #29775 -- Fixed URL converters in a nested namespaced path.
When using include() without namespaces of some urlpatterns that
have an include() with namespace, the converters of the parent
include() weren't being used to convert the arguments of reverse().
2018-10-04 11:42:27 -04:00
Jon Dufresne 5a23a285de Used skip(If|Unless)DBFeature in transactions tests. 2018-10-04 10:09:06 -04:00
Jon Dufresne 9f6d0c11eb Removed Jinja2 dependency from admin_checks tests. 2018-10-04 16:05:22 +02:00
Jon Dufresne 9b508bdb9b Removed unnecessary skipUnless in HTTPSitemapTests.
contrib.sites is included in INSTALLED_APPS by SitemapTestsBase.
2018-10-04 08:50:18 -04:00
Jon Dufresne bdae19cf63 Refs #27795 -- Removed force_bytes() usage in sessions.
SessionBase.decode() is the inverse operation to SessionBase.encode().
As SessionBase.encode() always returns a string, SessionBase.decode()
should always be passed a string argument. Fixed the file backend, which
was the only backend still passing a bytestring.
2018-10-03 11:11:42 +02:00
Stefano Chiodino 6de7f9ec60 Fixed #29598 -- Deprecated FloatRangeField in favor of DecimalRangeField. 2018-10-02 19:17:23 -04:00
Simon Charette bc7e288ca9 Fixed #29745 -- Based Expression equality on detailed initialization signature.
The old implementation considered objects initialized with an equivalent
signature different if some arguments were provided positionally instead of
as keyword arguments.

Refs #11964, #26167.
2018-10-02 19:15:20 -04:00
Nick Pope bf8b625a3b Refs #29722 -- Added introspection of materialized views for PostgreSQL. 2018-10-02 14:02:04 -04:00
Nick Pope 45ef3df7d0 Fixed #29719 -- Added introspection of foreign tables for PostgreSQL.
Thanks infinite-l00p for the initial patch.
2018-10-02 14:01:24 -04:00
Simon Charette 24dc7d8940 Refs #29641 -- Extracted reusable CheckConstraint logic into a base class. 2018-10-02 13:11:18 -04:00
Simon Charette 9142bebff2 Refs #11964 -- Changed CheckConstraint() signature to use keyword-only arguments.
Also renamed the `constraint` argument to `check` to better represent which
part of the constraint the provided `Q` object represents.
2018-10-02 10:53:04 -04:00
Przemysław Buczkowski 70d0a1ca02 Fixed #29711 -- Added a system check for uniquness of admin actions' __name__. 2018-10-02 09:17:23 -04:00
Jon Dufresne 7598cd4748 Fixed #29813 -- Fixed DatabaseOperation test when run in isolation on MySQL. 2018-10-02 08:22:38 -04:00
Abhinav Patil bf01994a5c Fixed #29804 -- Added 'did you mean' suggestions for unsupported lookup error. 2018-10-01 19:03:10 -04:00
Jon Dufresne b3b47bf515 Added tests for using bytearray with BinaryField and corrected docs. 2018-10-01 09:16:16 -04:00
Claude Paroz fc3a463048 Fixed #29767 -- Made date-related casts work on SQLite
Thanks Rémy Hubscher for the report and Tim Graham and Simon Charette for the reviews.
2018-10-01 13:27:30 +02:00
Tim Graham a7284cc0c3 Fixed #29809 -- Fixed a crash when a "view only" user POSTs to the admin user change form. 2018-10-01 10:09:50 +02:00
Carlton Gibson bf39978a53 Fixed CVE-2018-16984 -- Fixed password hash disclosure to admin "view only" users.
Thanks Claude Paroz & Tim Graham for collaborating on the patch.
2018-10-01 10:05:01 +02:00
Claude Paroz ddcb9e8062 Refs #21408 -- Updated naturaltime translation test.
Upcoming German translations will not differ for past and future naturaltime
translations. Using Czech language instead.
2018-09-29 15:06:11 +02:00
Sergey Fedoseev 8ef8bc0f64 Refs #28909 -- Simplifed code using unpacking generalizations. 2018-09-28 09:57:12 -04:00
Tim Graham 4fc8fb7dda
Tested showmigrations with apps without migrations. 2018-09-28 09:56:40 -04:00
Paweł Kołodziej 05c578bc1f Fixed #29796 -- Added system check for STATICFILES_DIRS prefix ending with a slash. 2018-09-27 19:49:37 -04:00
Marten Kenbeek 40c8ffad72 Fixed #29768 -- Improved error message when an AppConfig has a typo in INSTALLED_APPS. 2018-09-26 16:12:21 -04:00
Ramon Saraiva 2349cbd909 Fixed #29782 -- Added better error message when filtering queryset with AnonymousUser. 2018-09-26 15:36:19 -04:00
Matthew Power 18098d261f Fixed #29673 -- Reset the URLconf at the end of each request.
Co-authored-by: Ross Thorne <rmwthorne@googlemail.com>
2018-09-26 15:35:24 -04:00
Sergey Fedoseev 91841c77cd Fixed loaddata error message when uncompressed fixture has a dot in its name. 2018-09-26 15:30:15 -04:00
Jon Dufresne fb2964a410 Added test of filtering on BinaryField and corrected docs. 2018-09-26 14:38:12 -04:00
Mariusz Felisiak 024abe5b82
Fixed #29630 -- Fixed crash of sliced queries with multiple columns with the same name on Oracle 12.1.
Regression in 0899d583bd.

Thanks Tim Graham for the review and Jani Tiainen for help.
2018-09-26 20:18:48 +02:00
Jon Dufresne 82f286cf6f Refs #29784 -- Switched to https:// links where available. 2018-09-26 08:48:47 +02:00
Oleg d1d5c97bc2 Fixed #29778 -- Fixed quoting of unique index names.
Regression in 3b429c9673.
2018-09-25 16:00:20 -04:00
Alexey 8624459586 Added a test for password_changed() with a custom validator. 2018-09-25 11:58:05 -04:00
Jon Dufresne bb81c22d90 Refs #27795 -- Removed force_bytes() usage in utils/_os.py. 2018-09-25 11:27:36 -04:00
Ian Foote 9a0e0d966a Refs #11964 -- Renamed a database check constraint test. 2018-09-25 11:14:45 -04:00
Sergey Fedoseev 747db4018b Simplified AdminFieldExtractionMixin.get_admin_form_fields(). 2018-09-25 11:06:41 -04:00
Jon Dufresne 8c3e0eb1c1 Normalized spelling of "lowercase" and "lowercased". 2018-09-25 10:30:18 -04:00
Jon Dufresne ad9a28ee38 Refs #29784 -- Normalized Python docs links to omit the version. 2018-09-25 10:19:42 +02:00
Tim Graham 495abe0095 Refs #29198 -- Fixed migrate --plan crash if RunSQL uses a list or tuple.
Also fixed test failures if sqlparse isn't installed.
2018-09-19 17:13:39 -04:00
Javier Buzzi a0d63b02c3 Fixed #29772 -- Made LazyObject proxy __lt__() and __gt__(). 2018-09-19 13:51:01 -04:00
Tom Forbes 9cbdb44014 Fixed #23646 -- Added QuerySet.bulk_update() to efficiently update many models. 2018-09-18 16:14:44 -04:00
Mariusz Felisiak 7b159df942 Fixed expressions tests when run in reverse.
Regression in e7a0a5c8b2.
2018-09-18 15:58:20 -04:00
Claude Paroz f5e347a640 Fixed #27899 -- Added support for phrase/raw searching in SearchQuery.
Thanks Tim Graham, Nick Pope, and Claude Paroz for contribution and review.
2018-09-17 12:03:52 -04:00
Sergey Fedoseev c5e450ac95 Fixed #29761 -- Confirmed support for PROJ 5.x. 2018-09-17 12:03:30 -04:00
Adam Johnson 245c36d7b6 Fixed #29642 -- Added check for arguments of custom error handler views. 2018-09-14 11:59:56 -04:00
Simon Charette a4495f4b98 Fixed #29755 -- Made migrations detect changes to Meta.default_related_name. 2018-09-14 09:09:17 -04:00
Mariusz Felisiak e7a0a5c8b2
Simplified expressions.tests. 2018-09-13 22:12:21 +02:00
Ramiro Morales 1b1f64ee5a Refs #14357 -- Deprecated Meta.ordering affecting GROUP BY queries.
Thanks Ramiro Morales for contributing to the patch.
2018-09-13 12:29:48 -04:00
Tim Graham 32fbccab40
Fixed #29749 -- Made the migrations loader ignore files starting with a tilde or underscore.
Regression in 29150d5da8.
2018-09-11 12:51:11 -04:00
Tom Carrick a43cfc23d4 Fixed #29746 -- Fixed misleading FlatpageForm URL help text if APPEND_SLASH is disabled. 2018-09-11 12:15:22 -04:00
Hasan Ramezani 5195b99e2c Fixed #29560 -- Added --force-color management command option. 2018-09-11 11:15:42 -04:00
Tim Graham de8eb07c7a Reused a duplicated class in admin_scripts tests. 2018-09-11 10:50:51 -04:00
Srinivas Reddy Thatiparthy 34d6bceec4 Fixed #29500 -- Fixed SQLite function crashes on null values.
Co-authored-by: Srinivas Reddy Thatiparthy <thatiparthysreenivas@gmail.com>
Co-authored-by: Nick Pope <nick.pope@flightdataservices.com>
2018-09-10 15:08:55 -04:00
Krzysztof Gogolewski db926a0048 Fixed #29243 -- Improved efficiency of migration graph algorithm. 2018-09-10 09:57:31 -04:00
Michal Čihař 22e8ab0286 Fixed #29728 -- Prevented session resaving if CSRF cookie is unchanged. 2018-09-08 11:46:13 -04:00
Alexander Holmbäck f315d0423a Fixed #29727 -- Made nonexistent joins in F() raise FieldError.
Regression in 2162f0983d.
2018-09-08 09:40:33 -04:00
Alexander Holmbäck aa16ec5474 Moved test for nonexistent field in F() to BasicExpressionsTest. 2018-09-08 09:21:57 -04:00
Nick Pope 570402ffd7 Refs #29713 -- Improved error message from translation system check. 2018-09-06 13:49:25 +02:00
David 5db8d617c0 Fixed #29713 -- Added check that LANGUAGE_CODE uses standard language id format. 2018-09-03 10:43:55 +02:00
James Aylett ee52044a27 Refs #16470 -- Fixed typo in a FileResponse test. 2018-09-01 15:14:18 +02:00
Tim Graham fd8a7a5313 Fixed #29723 -- Fixed crash if InlineModelAdmin.has_add_permission() doesn't accept the obj argument.
* Refs #27991 -- Added testing for ModelAdmin.get_inline_instances() if the inline's has_add_permission() doesn't accept 'obj'.

* Fixed #29723 -- Fixed crash if InlineModelAdmin.has_add_permission() doesn't accept the obj argument.
2018-08-30 11:22:50 +02:00
Mariusz Felisiak 39461a83c3
Fixed #29694 -- Fixed column mismatch crash with QuerySet.values() or values_list() after combining querysets with extra() with union(), difference(), or intersection().
Regression in 0b66c3b442.
2018-08-29 10:00:15 +02:00
Nick Pope ed4bfacb3c Fixed #29703 -- Deprecated QuerySetPaginator alias.
Unused since 4406d283e1.
2018-08-27 16:23:43 -04:00
Dan Palmer e181666973 Fixed #29687 -- Allowed the test client to serialize list/tuple as JSON. 2018-08-25 10:57:05 -04:00
priyanshsaxena 83b04d4f88 Fixed #29048 -- Added **extra_context to database function as_vendor() methods. 2018-08-23 11:52:09 -04:00
Matthijs Kooijman 08f360355a Fixed #29704 -- Fixed manage.py test --testrunner if it isn't followed by an equals sign. 2018-08-23 10:12:03 -04:00
Matthijs Kooijman 69071e7f51 Added manage.py test --testrunner tests. 2018-08-23 10:12:03 -04:00