summaryrefslogtreecommitdiff
path: root/tests/backends/sqlite
diff options
context:
space:
mode:
authorSimon Charette <charettes@users.noreply.github.com>2017-10-06 12:47:08 -0400
committerTim Graham <timograham@gmail.com>2017-10-06 12:47:08 -0400
commit9d93dff33338c90a55f7158fbbe0d82e88e13fa3 (patch)
treee82f2500e84877ddf0aa303a0756cf01cf8e6a1f /tests/backends/sqlite
parent7d8d630e37209eba672d5382cc2effe192ab2510 (diff)
downloaddjango-9d93dff33338c90a55f7158fbbe0d82e88e13fa3.tar.gz
Fixed #28665 -- Change some database exceptions to NotImplementedError per PEP 249.
Diffstat (limited to 'tests/backends/sqlite')
-rw-r--r--tests/backends/sqlite/tests.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/backends/sqlite/tests.py b/tests/backends/sqlite/tests.py
index 3addcc8c34..0c07f95e6f 100644
--- a/tests/backends/sqlite/tests.py
+++ b/tests/backends/sqlite/tests.py
@@ -4,6 +4,7 @@ import unittest
from django.db import connection
from django.db.models import Avg, StdDev, Sum, Variance
+from django.db.utils import NotSupportedError
from django.test import TestCase, TransactionTestCase, override_settings
from ..models import Item, Object, Square
@@ -34,13 +35,13 @@ class Tests(TestCase):
Raise NotImplementedError when aggregating on date/time fields (#19360).
"""
for aggregate in (Sum, Avg, Variance, StdDev):
- with self.assertRaises(NotImplementedError):
+ with self.assertRaises(NotSupportedError):
Item.objects.all().aggregate(aggregate('time'))
- with self.assertRaises(NotImplementedError):
+ with self.assertRaises(NotSupportedError):
Item.objects.all().aggregate(aggregate('date'))
- with self.assertRaises(NotImplementedError):
+ with self.assertRaises(NotSupportedError):
Item.objects.all().aggregate(aggregate('last_modified'))
- with self.assertRaises(NotImplementedError):
+ with self.assertRaises(NotSupportedError):
Item.objects.all().aggregate(
**{'complex': aggregate('last_modified') + aggregate('last_modified')}
)