mirror of
https://github.com/django/django.git
synced 2025-08-03 02:23:12 +00:00
Refs #30055 -- Added a helpful error when SQLite is too old.
This commit is contained in:
parent
fcfb730658
commit
7444f32527
2 changed files with 18 additions and 0 deletions
|
@ -1,8 +1,12 @@
|
|||
import re
|
||||
import threading
|
||||
import unittest
|
||||
from sqlite3 import dbapi2
|
||||
from unittest import mock
|
||||
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.db import connection, transaction
|
||||
from django.db.backends.sqlite3.base import check_sqlite_version
|
||||
from django.db.models import Avg, StdDev, Sum, Variance
|
||||
from django.db.models.aggregates import Aggregate
|
||||
from django.db.models.fields import CharField
|
||||
|
@ -19,6 +23,13 @@ from ..models import Author, Item, Object, Square
|
|||
class Tests(TestCase):
|
||||
longMessage = True
|
||||
|
||||
def test_check_sqlite_version(self):
|
||||
msg = 'SQLite 3.8.3 or later is required (found 3.8.2).'
|
||||
with mock.patch.object(dbapi2, 'sqlite_version_info', (3, 8, 2)), \
|
||||
mock.patch.object(dbapi2, 'sqlite_version', '3.8.2'), \
|
||||
self.assertRaisesMessage(ImproperlyConfigured, msg):
|
||||
check_sqlite_version()
|
||||
|
||||
def test_aggregation(self):
|
||||
"""
|
||||
Raise NotImplementedError when aggregating on date/time fields (#19360).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue