Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit cf159e5c939fa609c94e4d762d9d9363a6601a95 1 parent 31f6421
Shai Berger shaib authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  tests/get_or_create/tests.py
3  tests/get_or_create/tests.py
View
@@ -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):
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:
Please sign in to comment.
Something went wrong with that request. Please try again.