mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #12991 -- Added unittest2 support. Thanks to PaulM for the draft patch, and to Luke, Karen, Justin, Alex, Łukasz Rekucki, and Chuck Harmston for their help testing and reviewing the final patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14139 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -17,7 +17,7 @@ except ImportError:
|
||||
|
||||
from django.conf import settings
|
||||
from django.core import serializers, management
|
||||
from django.db import transaction, DEFAULT_DB_ALIAS
|
||||
from django.db import transaction, DEFAULT_DB_ALIAS, connection
|
||||
from django.test import TestCase
|
||||
from django.utils.functional import curry
|
||||
|
||||
@@ -335,7 +335,7 @@ The end."""),
|
||||
# Because Oracle treats the empty string as NULL, Oracle is expected to fail
|
||||
# when field.empty_strings_allowed is True and the value is None; skip these
|
||||
# tests.
|
||||
if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'] == 'django.db.backends.oracle':
|
||||
if connection.features.interprets_empty_strings_as_nulls:
|
||||
test_data = [data for data in test_data
|
||||
if not (data[0] == data_obj and
|
||||
data[2]._meta.get_field('data').empty_strings_allowed and
|
||||
@@ -344,7 +344,7 @@ if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'] == 'django.db.backends.oracle'
|
||||
# Regression test for #8651 -- a FK to an object iwth PK of 0
|
||||
# This won't work on MySQL since it won't let you create an object
|
||||
# with a primary key of 0,
|
||||
if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'] != 'django.db.backends.mysql':
|
||||
if connection.features.allows_primary_key_0:
|
||||
test_data.extend([
|
||||
(data_obj, 0, Anchor, "Anchor 0"),
|
||||
(fk_obj, 465, FKData, 0),
|
||||
|
||||
Reference in New Issue
Block a user