mirror of
https://github.com/django/django.git
synced 2025-03-28 10:10:45 +00:00
Added a skip for a test that fails in Oracle. Unlike other backends, Oracle does not allow duplicate rows where there is a unique_together constraint for which some but not all of the columns are NULL.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15777 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
409435440a
commit
d9e61a435a
@ -266,6 +266,10 @@ class BaseDatabaseFeatures(object):
|
|||||||
# Does the backend distinguish between '' and None?
|
# Does the backend distinguish between '' and None?
|
||||||
interprets_empty_strings_as_nulls = False
|
interprets_empty_strings_as_nulls = False
|
||||||
|
|
||||||
|
# Does the backend allow inserting duplicate rows when a unique_together
|
||||||
|
# constraint exists, but one of the unique_together columns is NULL?
|
||||||
|
ignores_nulls_in_unique_constraints = True
|
||||||
|
|
||||||
can_use_chunked_reads = True
|
can_use_chunked_reads = True
|
||||||
can_return_id_from_insert = False
|
can_return_id_from_insert = False
|
||||||
uses_autocommit = False
|
uses_autocommit = False
|
||||||
|
@ -76,6 +76,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
|
|||||||
supports_timezones = False
|
supports_timezones = False
|
||||||
supports_bitwise_or = False
|
supports_bitwise_or = False
|
||||||
can_defer_constraint_checks = True
|
can_defer_constraint_checks = True
|
||||||
|
ignores_nulls_in_unique_constraints = False
|
||||||
|
|
||||||
class DatabaseOperations(BaseDatabaseOperations):
|
class DatabaseOperations(BaseDatabaseOperations):
|
||||||
compiler_module = "django.db.backends.oracle.compiler"
|
compiler_module = "django.db.backends.oracle.compiler"
|
||||||
|
@ -7,7 +7,7 @@ from django import forms
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
from django.forms.models import (_get_foreign_key, inlineformset_factory,
|
from django.forms.models import (_get_foreign_key, inlineformset_factory,
|
||||||
modelformset_factory, modelformset_factory)
|
modelformset_factory, modelformset_factory)
|
||||||
from django.test import TestCase
|
from django.test import TestCase, skipUnlessDBFeature
|
||||||
|
|
||||||
from modeltests.model_formsets.models import (
|
from modeltests.model_formsets.models import (
|
||||||
Author, BetterAuthor, Book, BookWithCustomPK, Editor,
|
Author, BetterAuthor, Book, BookWithCustomPK, Editor,
|
||||||
@ -577,10 +577,13 @@ class ModelFormsetTest(TestCase):
|
|||||||
self.assertEqual(book1.title, 'Flowers of Evil')
|
self.assertEqual(book1.title, 'Flowers of Evil')
|
||||||
self.assertEqual(book1.notes, 'English translation of Les Fleurs du Mal')
|
self.assertEqual(book1.notes, 'English translation of Les Fleurs du Mal')
|
||||||
|
|
||||||
|
@skipUnlessDBFeature('ignores_nulls_in_unique_constraints')
|
||||||
|
def test_inline_formsets_with_nullable_unique_together(self):
|
||||||
# Test inline formsets where the inline-edited object has a
|
# Test inline formsets where the inline-edited object has a
|
||||||
# unique_together constraint with a nullable member
|
# unique_together constraint with a nullable member
|
||||||
|
|
||||||
AuthorBooksFormSet4 = inlineformset_factory(Author, BookWithOptionalAltEditor, can_delete=False, extra=2)
|
AuthorBooksFormSet4 = inlineformset_factory(Author, BookWithOptionalAltEditor, can_delete=False, extra=2)
|
||||||
|
author = Author.objects.create(pk=1, name='Charles Baudelaire')
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
'bookwithoptionalalteditor_set-TOTAL_FORMS': '2', # the number of forms rendered
|
'bookwithoptionalalteditor_set-TOTAL_FORMS': '2', # the number of forms rendered
|
||||||
|
Loading…
x
Reference in New Issue
Block a user