1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Used NotSupportedError instead of DatabaseError in SQLCompiler.as_sql().

This commit is contained in:
Mariusz Felisiak
2017-04-10 18:49:27 +02:00
committed by Tim Graham
parent d825ac6dfa
commit 054a44d6f0
4 changed files with 11 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
from django.db.models import F, IntegerField, Value
from django.db.utils import DatabaseError
from django.db.utils import DatabaseError, NotSupportedError
from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature
from .models import Number, ReservedName
@@ -73,8 +73,8 @@ class QuerySetSetOperationTests(TestCase):
def test_unsupported_intersection_raises_db_error(self):
qs1 = Number.objects.all()
qs2 = Number.objects.all()
msg = 'intersection not supported on this database backend'
with self.assertRaisesMessage(DatabaseError, msg):
msg = 'intersection is not supported on this database backend'
with self.assertRaisesMessage(NotSupportedError, msg):
list(qs1.intersection(qs2))
def test_combining_multiple_models(self):