If the test user creation fails here, _create_test_db() would return without
switching to the test user which caused the tests to run using the main
connection instead of the test user.
rather than just relying on manipulation of settings to determine which
invocation of connection.cursor() opens a connection to the test database
and which opens a connection to the main database.
Thanks Aymeric Augustin for motivation and Tim Graham for review.
Use INTERVAL DAY(9) TO SECOND(6) for Durationfield on Oracle rather than
storing as a NUMBER(19) of microseconds.
There are issues with cx_Oracle which require some extra data
manipulation in the database backend when constructing queries, but it
handles the conversion back to timedelta objects cleanly.
Thanks to Shai for the review.
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.
Checked database destruction for ORA-29857, which happens when objects of
some types are left over in an old test database (notably, such objects
are created by the GIS backend). When this happens, we can resolve the
issue by dropping the test-user (if we are allowed to).
An alternative approach, to just switch the order of creation (so that,
if the test user exists and can be dropped, it is always dropped before
the tablespace) was considered; but since the user creation depends on
the tablespace, this would necessitate separating the dropping of the user
from its creation -- a change I am reluctant to make.
Thanks Josh Smeaton and Tim Graham for reviews.
because the roles (specifically RESOURCE) are deprecated.
Also added optional support for creating views in tests, and made an
introspection test fail (rather than skip) if a view cannot be created
due to lacking privileges.
Refs #18782
Thanks Tim Graham for review, and Josh Smeaton
Change database test settings from "TEST_"-prefixed entries in the
database settings dictionary to setting in a dictionary that is itself
an entry "TEST" in the database settings.
Refs #21775
Thanks Josh Smeaton for review.
Implemented this by adding an internal hook for work that should be performed
before that point.
Also, regarding the `DatabaseCreation.set_autocommit()` method:
* Stop using it for such tasks
* Stop providing an implementation that tries to cover all the possible
idioms a third party database backend DB-API 2 driver could need to activate
autocommit. It is now left for third party backends to implement.
This can be backwards incompatible in the case of user applications that:
* Had started using this method
* Use a third a party database backend
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16520 bcc190cf-cafb-0310-a4f2-bffc1f526a37
In Oracle, the name of a DB as handled by Django hasn't a counterpart anyway. So use the 'production DB name' as it was done before.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14993 bcc190cf-cafb-0310-a4f2-bffc1f526a37