Browse files

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.
  • Loading branch information...
1 parent 31f6421 commit cf159e5c939fa609c94e4d762d9d9363a6601a95 @shaib shaib committed May 25, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 tests/get_or_create/
@@ -5,6 +5,7 @@
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 @@ def test_savepoint_rollback(self):
birthday=date(1970, 1, 1),
defaults={'first_name': "\xff", 'last_name': "\xff"})
- except DatabaseError:
+ except (DatabaseError, DjangoUnicodeDecodeError):
first_name="Bob", last_name="Ross", birthday=date(1950, 1, 1))

0 comments on commit cf159e5

Please sign in to comment.