1
0
mirror of https://github.com/django/django.git synced 2025-07-05 02:09:13 +00:00

[1.2.X] 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.

Backport of r15777 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15778 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Ian Kelly 2011-03-08 22:50:56 +00:00
parent e81e64cd63
commit 05b197dbb1

View File

@ -4,7 +4,8 @@ from datetime import date
from decimal import Decimal from decimal import Decimal
from django import forms from django import forms
from django.db import models from django.conf import settings
from django.db import models, DEFAULT_DB_ALIAS
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
@ -577,10 +578,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')
if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'] != 'django.db.backends.oracle':
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