summaryrefslogtreecommitdiff
path: root/tests/backends/sqlite
diff options
context:
space:
mode:
Diffstat (limited to 'tests/backends/sqlite')
-rw-r--r--tests/backends/sqlite/tests.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/backends/sqlite/tests.py b/tests/backends/sqlite/tests.py
index 34c0eca0ff..f47e96be4e 100644
--- a/tests/backends/sqlite/tests.py
+++ b/tests/backends/sqlite/tests.py
@@ -31,13 +31,17 @@ class Tests(TestCase):
def test_aggregation(self):
"""Raise NotSupportedError when aggregating on date/time fields."""
for aggregate in (Sum, Avg, Variance, StdDev):
- with self.assertRaises(NotSupportedError):
+ msg = (
+ f"SQLite does not support {aggregate.__name__} on date or "
+ "time fields, because they are stored as text."
+ )
+ with self.assertRaisesMessage(NotSupportedError, msg):
Item.objects.aggregate(aggregate("time"))
- with self.assertRaises(NotSupportedError):
+ with self.assertRaisesMessage(NotSupportedError, msg):
Item.objects.aggregate(aggregate("date"))
- with self.assertRaises(NotSupportedError):
+ with self.assertRaisesMessage(NotSupportedError, msg):
Item.objects.aggregate(aggregate("last_modified"))
- with self.assertRaises(NotSupportedError):
+ with self.assertRaisesMessage(NotSupportedError, msg):
Item.objects.aggregate(
**{
"complex": aggregate("last_modified")