summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShai Berger <shai@platonix.com>2013-05-26 01:39:34 +0300
committerShai Berger <shai@platonix.com>2013-05-26 01:39:34 +0300
commitcf159e5c939fa609c94e4d762d9d9363a6601a95 (patch)
tree6a6151dc45a1d4e8214797e87d75bf45f7e3e063
parent31f6421b134e4e83a459d2faa1009b33fefd6276 (diff)
Fix get_or_create test failure under Oracle
Test expected that when given invalid utf-8, the backend should raise a DatabaseError, but the Oracle backend raises a UnicodeDecodeError.
-rw-r--r--tests/get_or_create/tests.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/get_or_create/tests.py b/tests/get_or_create/tests.py
index 5a5956bf74..5eb5edd6d9 100644
--- a/tests/get_or_create/tests.py
+++ b/tests/get_or_create/tests.py
@@ -5,6 +5,7 @@ import traceback
import warnings
from django.db import IntegrityError, DatabaseError
+from django.utils.encoding import DjangoUnicodeDecodeError
from django.test import TestCase, TransactionTestCase
from .models import Person, ManualPrimaryKeyTest, Profile, Tag, Thing
@@ -76,7 +77,7 @@ class GetOrCreateTests(TestCase):
Person.objects.get_or_create(
birthday=date(1970, 1, 1),
defaults={'first_name': "\xff", 'last_name': "\xff"})
- except DatabaseError:
+ except (DatabaseError, DjangoUnicodeDecodeError):
Person.objects.create(
first_name="Bob", last_name="Ross", birthday=date(1950, 1, 1))
else: