Commit Graph

80 Commits

Author SHA1 Message Date
Nick Pope d13a9e44de Fixed #28909 -- Simplified code using tuple/list/set/dict unpacking. 2017-12-11 07:08:45 -05:00
Jon Dufresne 7a6fbf36b1 Fixed #28853 -- Updated connection.cursor() uses to use a context manager. 2017-11-28 11:28:09 -05:00
Mariusz Felisiak 6784383e93 Fixed #28498 -- Fixed test database creation with cx_Oracle 6. 2017-08-16 18:39:58 +02:00
Mariusz Felisiak 516b7664dc Fixed #28260 -- Allowed customizing the test tablespace initial and autoextend size on Oracle.
Thanks Tim Graham for the review.
2017-06-02 18:35:56 +02:00
Anton Samarchyan 60e52a047e Refs #27656 -- Updated django.db docstring verbs according to PEP 257. 2017-02-28 09:17:27 -05:00
Mariusz Felisiak 965f678a39 Fixed #25898 -- Made test database/user creation on Oracle reraise unexpected errors.
Thanks Shai Berger and Tim Graham for review.
2017-02-09 17:55:07 -05:00
Claude Paroz 2b281cc35e Refs #23919 -- Removed most of remaining six usage
Thanks Tim Graham for the review.
2017-01-18 21:33:28 +01:00
Mariusz Felisiak 7d2db2a7b8 Refs #27690 -- Removed sleep before drop test db on Oracle. 2017-01-16 19:20:28 -05:00
Mariusz Felisiak dacef9137f Refs #27420 -- Removed exception hiding in Oracle test user creation during --keepdb.
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.
2016-11-08 16:53:52 -05:00
Mariusz Felisiak c4b04e1598 Fixed #27420 -- Quoted the Oracle test user password in queries. 2016-11-08 16:30:22 -05:00
Marti Raudsepp da7910d483 Fixed CVE-2016-9013 -- Generated a random database user password when running tests on Oracle.
This is a security fix.
2016-11-01 09:30:57 -04:00
Mariusz Felisiak a3a6def867 Fixed #25421 -- Fixed test --keepdb option on Oracle. 2015-09-26 19:51:15 -04:00
Ville Skyttä afe777639c Fixed #25196 -- Normalized database representations in test database messages.
Left over Oracle mostly as-is since it's more complicated.
2015-09-25 10:21:55 -04:00
Shai Berger abd7e48af7 Changed Oracle's test-database-creation to use an explicit main-db-connection
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.
2015-06-20 23:48:18 +03:00
Shai Berger 35291df7f7 Fixed #19542: Made mirroring databases for tests work with Oracle
No tests are provided because there is no sane way to test database
settings within the Django test suite.

Thanks Aymeric Augustin for review.
2015-06-05 12:29:15 +03:00
Tim Graham 0ed7d15563 Sorted imports with isort; refs #23860. 2015-02-06 08:16:28 -05:00
Tim Graham 28308078f3 Fixed #22603 -- Reorganized classes in django.db.backends. 2015-01-14 14:16:20 -05:00
Tim Graham 93d73dac91 Moved DatabaseCreation.data_types properties to DatabaseWrapper.
refs #22340.
2014-12-31 08:29:17 -05:00
Tim Graham 8082c75d18 Removed db.backends methods which only call super(). 2014-12-30 11:53:59 -05:00
Marc Tamlyn 5ca82e710e Fixed #24033 -- Use interval type on Oracle.
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.
2014-12-23 10:38:32 +00:00
Marc Tamlyn 57554442fe Fixed #2443 -- Added DurationField.
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.
2014-12-20 18:28:29 +00:00
Shai Berger 2e1ed5f33c Fixed #23649 -- Made Oracle test-db creation drop test-user earlier when needed
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.
2014-10-17 04:46:15 +03:00
Shai Berger d128eac316 Changed Oracle test-user creation to grant privileges instead of roles
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
2014-09-24 04:58:33 +03:00
Josh Smeaton 0eb5cde9da Fixed #21775 -- Allowed customization of datafile for Oracle tablespace 2014-09-17 09:55:33 -04:00
Marc Tamlyn ed7821231b Fixed #19463 -- Added UUIDField
Uses native support in postgres, and char(32) on other backends.
2014-09-16 10:08:09 +01:00
Tim Graham 1101467ce0 Limited lines to 119 characters in django/
refs #23395.
2014-09-05 09:22:16 -04:00
Shai Berger 4c85a0d95f Made main user disconnect after creating test user/tablespaces on Oracle 2014-08-25 20:20:10 +03:00
Greg Chapple b7aa7c4ab4 Fixed #20550 -- Added ability to preserve test db between runs 2014-05-28 16:22:46 +01:00
Shai Berger 41afae4ce9 Reorganized the database test settings
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.
2014-03-09 03:57:18 +02:00
coagulant 3bc0d46a84 Fixed all E261 warnings 2013-11-02 18:20:39 -04:00
Садовский Николай 1185370c2c Fixed #20707 -- Added explicit quota assignment to Oracle test user
To enable testing on Oracle 12c
2013-09-09 16:25:13 +03:00
Andrew Godwin 44f907dd98 Start of getting Oracle to do schema stuff 2013-08-12 20:05:20 +01:00
Andrew Godwin 03ec3219a0 Merge branch 'master' into schema-alteration
Conflicts:
	django/db/backends/mysql/introspection.py
	django/db/backends/oracle/creation.py
	django/db/backends/postgresql_psycopg2/creation.py
	django/db/models/base.py
	django/db/models/loading.py
2013-07-22 19:04:25 +01:00
Alex Gaynor 03d9566e0d A large number of stylistic cleanups across django/db/ 2013-07-08 10:39:54 +10:00
Andrew Godwin 3c296382b8 Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts:
	django/db/models/fields/related.py
2013-06-07 11:15:34 +01:00
Claude Paroz d595b61aca (Re-)moved some imports 2013-05-21 17:34:19 +02:00
Andrew Godwin 7f3678dc4c Merge branch 'master' into schema-alteration
Conflicts:
	django/db/backends/__init__.py
	django/db/backends/mysql/base.py
	django/db/backends/oracle/base.py
	django/db/backends/oracle/creation.py
	django/db/backends/postgresql_psycopg2/base.py
	django/db/backends/sqlite3/base.py
	django/db/models/fields/related.py
2013-04-18 17:16:39 +01:00
Aymeric Augustin f515619494 Added an API to control database-level autocommit. 2013-03-11 14:48:53 +01:00
Claude Paroz 8ee1eddb7e Add a BinaryField model field
Thanks Michael Jung, Charl Botha and Florian Apolloner for review
and help on the patch.
2013-03-02 10:29:02 +01:00
Andrew Godwin b62e82365a Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts:
	django/db/models/loading.py
	django/db/models/options.py
2012-12-18 09:02:07 +00:00
Anssi Kääriäinen 905ea9619b Made sure global settings are changed in test db creation
There was an assumption that changing connection.settings_dict changed
also the settings.DATABASES values. This assumption is now gone.
2012-11-27 19:47:20 +02:00
Andrew Godwin 8413c85f3d Very initial Oracle support 2012-09-07 15:48:22 -04:00
Claude Paroz b8e49d70f2 [py3] Replaced raw_input by input
The six addition has been borrowed from:
https://bitbucket.org/gutworth/six/changeset/733ef740
2012-08-08 19:53:11 +02:00
Claude Paroz 596cb9c7e2 Replaced print statement by print function (forward compatibility syntax). 2012-04-30 20:45:03 +02:00
Claude Paroz 3904b74a3f Fixed #18013 -- Use the new 'as' syntax for exceptions.
Thanks Clueless for the initial patch.
Note that unittest has been purposely left out (external package only used by Python 2.6).
2012-04-29 20:57:15 +02:00
Aymeric Augustin 97061bdf30 Fixed #17786 (again) -- Ensured destruction of test databases works under Oracle, even with multiple databases, after r17411.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17601 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-28 21:23:45 +00:00
Aymeric Augustin 4b641b78fa Fixed #17786 -- Exception when running the tests under Oracle, during the destruction of the test database.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17599 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-28 09:50:18 +00:00
Jannis Leidel 24f4764a48 Fixed #16225 -- Removed unused imports. Many thanks to Aymeric Augustin for the work on the patch and Alex for reviewing.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-13 09:35:51 +00:00
Ramiro Morales 569aa34ea5 Fixed #16250 -- Made test database creation support code in the PostgreSQL DB backend compatible with psycopg2 2.4.2.
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
2011-07-06 23:25:30 +00:00
Jannis Leidel ce3c281090 Fixed #811 -- Added support for IPv6 to forms and model fields. Many thanks to Erik Romijn.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16366 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-11 13:48:24 +00:00