summaryrefslogtreecommitdiff
path: root/tests/backends
AgeCommit message (Collapse)Author
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.
2019-07-30Refs #30593 -- Fixed introspection of check constraints columns on MariaDB.Hasan Ramezani
2019-07-30Refs #30593 -- Added _parse_constraint_columns() hook to introspection on ↵Hasan Ramezani
MariaDB.
2019-07-16Fixed #30636 -- Fixed options ordering when cloning test database on MySQL.Yann Sionneau
--defaults-file must be given before other options.
2019-07-08Refs #29444 -- Added support for fetching a returned non-integer insert ↵Johannes Hoppe
values on Oracle. This is currently not actively used, since the ORM will ask the SQL compiler to only return auto fields.
2019-04-29Fixed #30148 -- Logged COPY ... TO statements in connection.queries on ↵kingbuzzman
PostgreSQL.
2019-04-29Added tests for queries log in CursorDebugWrapper.executemany().Mariusz Felisiak
2019-04-18Fixed typos in docs, comments, and exception messages.Ville Skyttä
2019-04-05Refs #20010 -- Unified DatabaseOperations.last_executed_query() on Oracle ↵Mariusz Felisiak
with other db backends. Thanks Simon Charette for the review.
2019-04-04Fixed #30307 -- Fixed incorrect quoting of database user password when using ↵msg
dbshell on Oracle. Regression in acfc650f2a6e4a79e80237eabfa923ea3a05d709.
2019-03-13Fixed #30183 -- Added introspection of inline SQLite constraints.Paveł Tyślacki
2019-02-21Fixed a failure when running tests on systems with SQLite < 3.8.3.Tim Graham
2019-02-20Fixed #30193, Refs #28478 -- Avoided PostgreSQL connection health checks on ↵Simon Charette
initialization. This addressed a regression introduced by a96b9019320ed8236659ee520a7a017c1bafbc6f as identified by Ran Benita.
2019-02-14Fixed #30171 -- Fixed DatabaseError in servers tests.Jon Dufresne
Made DatabaseWrapper thread sharing logic reentrant. Used a reference counting like scheme to allow nested uses. The error appeared after 8c775391b78b2a4a2b57c5e89ed4888f36aada4b.
2019-02-12Simplified test_cursor_var() by using str instead of Database.STRING.Mariusz Felisiak
2019-02-09Removed uneeded iter() calls with generator expression as argument.Sergey Fedoseev
2019-01-28Refs #30055 -- Added a helpful error when SQLite is too old.Tim Graham
2019-01-19Fixed #30117 -- Fixed SchemaEditor.quote_value() test for mysqlclient 1.4.0+.Mariusz Felisiak
2019-01-14Refs #28478 -- Prevented database feature based skipping on tests ↵Simon Charette
disallowing queries. Database features may require a connection to be established to determine whether or not they are enabled.