summaryrefslogtreecommitdiff
path: root/tests/backends
AgeCommit message (Collapse)Author
2021-03-30[3.2.x] Fixed #32595 -- Fixed SchemaEditor.quote_value() crash with bytes.Mariusz Felisiak
Backport of f6018c1e63a04e0c12e2ca759e76e05ccf5e09de from main
2021-03-30[3.2.x] Refs #32595 -- Added MySQL's SchemaEditor.quote_value() tests for ↵Mariusz Felisiak
values with Unicode chars. Backport of 3c75f1f3cac7985e8a134fc1c33eb6e01639a04b from main
2021-02-02[3.2.x] Fixed #32403 -- Fixed re-raising DatabaseErrors when using only ↵Mariusz Felisiak
'postgres' database. Thanks Kazantcev Andrey for the report. Regression in f48f671223a20b161ca819cf7d6298e43b8ba5fe. Backport of f131841c601b9d4884adcdb284b4213c2ad89231 from master
2021-01-13Fixed #26167 -- Added support for functional indexes.Hannes Ljungberg
Thanks Simon Charette, Mads Jensen, and Mariusz Felisiak for reviews. Co-authored-by: Markus Holtermann <info@markusholtermann.eu>
2020-12-30Fixed #32303 -- Bumped minimum supported SQLite to 3.9.0.Mariusz Felisiak
2020-12-28Fixed #32158 -- Fixed loaddata crash on SQLite when table/column names are ↵Chinmoy Chakraborty
SQL keywords.
2020-12-11Refs #32178 -- Fixed test_mark_expected_failures_and_skips_call teardown.Tim Graham
Test isolation failure observed on CockroachDB and PostgreSQL.
2020-12-10Fixed #32178 -- Allowed database backends to skip tests and mark expected ↵Hasan Ramezani
failures. Co-authored-by: Tim Graham <timograham@gmail.com>
2020-11-25Fixed #32224 -- Avoided suppressing connection errors in supports_json_field ↵Mariusz Felisiak
on SQLite.` Regression in 6789ded0a6ab797f0dcdfa6ad5d1cfa46e23abcd. Thanks Juan Garcia Alvite for the report.
2020-11-11Fixed #31762 -- Made reloading the database for tests use the base manager.Hasan Ramezani
Co-authored-by: Eugene Kulak <kulak.eugene@gmail.com>
2020-10-29Refs #32061 -- Unified DatabaseClient.runshell() in db backends.Simon Charette
2020-10-28Made small readability improvements.Martin Thoma
2020-09-23Fixed #32012 -- Made test database creation sync apps models when migrations ↵Mariusz Felisiak
are disabled. Thanks Jaap Roes for the report.
2020-09-13Corrected tests.backends.sqlite.tests.Tests.test_aggregation()'s docstring.Mariusz Felisiak
2020-08-28Fixed #31956 -- Fixed crash of ordering by JSONField with a custom decoder ↵Mariusz Felisiak
on PostgreSQL. Thanks Marc Debureaux for the report. Thanks Simon Charette, Nick Pope, and Adam Johnson for reviews.
2020-07-30Bumped minimum isort version to 5.1.0.David Smith
Fixed inner imports per isort 5. isort 5.0.0 to 5.1.0 was unstable.
2020-07-20Fixed #17653 -- Allowed using zero as AutoFields value on MySQL if ↵Mariusz Felisiak
NO_AUTO_VALUE_ON_ZERO SQL mode is enabled.
2020-06-30Fixed #28925 -- Fixed durations-only expressions crash on SQLite and MySQL.Sergey Fedoseev
This removes also unused DatabaseOperations.date_interval_sql().
2020-05-11Refs #30116 -- Simplified regex match group access with Match.__getitem__().Jon Dufresne
The method has been available since Python 3.6. The shorter syntax is also marginally faster.
2020-05-08Fixed #12990, Refs #27694 -- Added JSONField model field.sage
Thanks to Adam Johnson, Carlton Gibson, Mariusz Felisiak, and Raphael Michel for mentoring this Google Summer of Code 2019 project and everyone else who helped with the patch. Special thanks to Mads Jensen, Nick Pope, and Simon Charette for extensive reviews. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2020-05-06Fixed a/an typos in "SQL" usage.Adam Johnson
2020-04-21Fixed backends.oracle.test_operations.Mariusz Felisiak
Using unittest.TestCase doesn't work properly when we perform db queries. Moreover introspection is extremely slow on Oracle without limiting models to a "backends" app. Follow up to 8bcca47e8356521f52f0738d9633befd53007cae.
2020-04-21Fixed #31479 -- Added support to reset sequences on SQLite.Jon Dufresne
2020-04-20Capitalized Unicode in docs, strings, and comments.Jon Dufresne
2020-04-20Fixed #31477 -- Removed "using" argument from ↵Jon Dufresne
DatabaseOperations.execute_sql_flush().
2020-04-18Simplified LongNameTest.test_sequence_name_length_limits_flush() with ↵Jon Dufresne
execute_sql_flush().
2020-04-17Fixed #31473 -- Made sql_flush() use RESTART IDENTITY to reset sequences on ↵Jon Dufresne
PostgreSQL. The sql_flush() positional argument sequences is replaced by the boolean keyword-only argument reset_sequences. This ensures that the old function signature can't be used by mistake when upgrading Django. When the new argument is True, the sequences of the truncated tables will reset. Using a single boolean value, rather than a list, allows making a binary yes/no choice as to whether to reset all sequences rather than a working on a completely different set.
2020-04-17Added test coverage for DatabaseOperations.sql_flush().Jon Dufresne
2020-04-08Fixed typo in tests/backends/base/test_operations.py.Mariusz Felisiak
2020-04-02Refs #31051 -- Fixed reloading the database with circular related objects ↵Matthijs Kooijman
and natural keys for tests. Made deserialize_db_from_string() do not sort dependencies. deserialize_db_from_string() doesn't use natural keys, so there is no need to sort dependencies in serialize_db_to_string(). Moreover, sorting models cause issues for circular dependencies.
2020-04-02Refs #26552 -- Added test for reloading the database with self-referential ↵Matthijs Kooijman
objects.
2020-03-06Fixed #31345 -- Added BaseDatabaseIntrospection.get_relations().shankarj67
2020-03-04Fixed #31333 -- Added BaseDatabaseIntrospection.get_table_description().aryan
2020-03-04Added tests for BaseDatabaseIntrospection's stub methods.Mariusz Felisiak
2020-02-24Fixed backends tests on Oracle.Mariusz Felisiak
Using Person in test_introspection caused removing constraints in intermediate table for ManyToManyField in VeryLongModelNameZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ that were expected by other transaction tests. A model without any constraints was used to prevent isolation issues.
2020-02-19Fixed tests when run in reverse.Mariusz Felisiak
Regression in 98f23a8af0be7e87535426c5c83058e2682bfdf8.
2020-02-18Fixed #31271 -- Preserved ordering when unifying query parameters on Oracle.Mariusz Felisiak
This caused misplacing parameters in logged SQL queries. Regression in 79065b55a70cd220820a260a1c54851b7be0615a. Thanks Hans Aarne Liblik for the report.
2020-02-18Fixed #31228 -- Reallowed aggregates to be used with multiple expressions ↵Taoup
and no DISTINCT on SQLite. Regression in bc05547cd8c1dd511c6b6a6c873a1bc63417b111. Thanks Andy Terra for the report.
2020-02-14Fixed #26552 -- Deferred constraint checks when reloading the database with ↵Matthijs Kooijman
data for tests. deserialize_db_from_string() loads the full serialized database contents, which might contain forward references and cycles. That caused IntegrityError because constraints were checked immediately. Now, it loads data in a transaction with constraint checks deferred until the end of the transaction.
2020-02-06Fixed #31233 -- Closed database connections and cursors after use.Jon Dufresne
2020-02-06Refs #31233 -- Changed DatabaseWrapper._nodb_connection to _nodb_cursor().Jon Dufresne
It is now a method instead of a property and returns a context manager that yields a cursor on entry and closes the cursor and connection upon exit.
2020-02-04Simplified imports from django.db and django.contrib.gis.db.Nick Pope
2020-01-20Refs #31117 -- Made various tests properly handle unexpected databases aliases.Matthijs Kooijman
- Used selected "databases" instead of django.db.connections. - Made routers in tests.migrations skip migrations on unexpected databases. - Added DiscoverRunnerGetDatabasesTests.assertSkippedDatabases() hook which properly asserts messages about skipped databases.
2020-01-20Fixed #31117 -- Isolated backends.base.test_creation.TestDbCreationTests.Matthijs Kooijman
Previously, this test could modify global state by changing connection.settings_dict. This dict is a reference to the same dict as django.db.connections.databases['default'], which is thus also changed. The cleanup of this test would replace connection.settings_dic` with a saved copy, which would leave the dict itself modified. Additionally, create_test_db() would also modify these same dicts, as well as settings.databases['default']['NAME'] by adding a "test_" prefix, which is what can cause problems later. This patch: - makes a complete copy of the connection and work on that, to improve isolation. - calls destroy_test_db() to let that code clean up anything done by create_test_db().
2020-01-20Refs #31117 -- Moved get_connection_copy() test hook to a module level.Mariusz Felisiak
2019-12-31Refs #31117 -- Isolated backends.sqlite.test_creation.TestDbSignatureTests.Mariusz Felisiak
2019-11-21Fixed #30413 -- Fixed test database signature on SQLite when test database ↵Farhaan Bukhsh
name is provided. Previously, the same signature was created for multiple in-memory databases on SQLite when they had tests databases names DATABASES['TEST']['NAME'].
2019-11-20Fixed #25388 -- Added an option to allow disabling of migrations during test ↵Jon Dufresne
database creation.
2019-11-07Refs #29983 -- Added support for using pathlib.Path in all settings.Jon Dufresne
2019-09-09Refs #29444 -- Allowed returning multiple fields from INSERT statements on ↵Johannes Hoppe
PostgreSQL. Thanks Florian Apolloner, Tim Graham, Simon Charette, Nick Pope, and Mariusz Felisiak for reviews.