Parcourir la source

Refs #30027 -- Enabled window function tests on SQLite 3.25+.

Simon Charette il y a 6 ans
Parent
commit
ebd2fe1861
2 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. 1 0
      django/db/backends/sqlite3/features.py
  2. 5 0
      tests/expressions_window/tests.py

+ 1 - 0
django/db/backends/sqlite3/features.py

@@ -40,3 +40,4 @@ class DatabaseFeatures(BaseDatabaseFeatures):
     supports_pragma_foreign_key_check = Database.sqlite_version_info >= (3, 20, 0)
     can_defer_constraint_checks = supports_pragma_foreign_key_check
     supports_functions_in_partial_indexes = Database.sqlite_version_info >= (3, 15, 0)
+    supports_over_clause = Database.sqlite_version_info >= (3, 25, 0)

+ 5 - 0
tests/expressions_window/tests.py

@@ -537,6 +537,7 @@ class WindowFunctionTests(TestCase):
         ], transform=lambda row: (row.name, row.salary, row.department, row.hire_date, row.sum))
 
     @skipIf(connection.vendor == 'postgresql', 'n following/preceding not supported by PostgreSQL')
+    @skipIf(connection.vendor == 'sqlite', 'n following/preceding not supported by SQLite')
     def test_range_n_preceding_and_following(self):
         qs = Employee.objects.annotate(sum=Window(
             expression=Sum('salary'),
@@ -584,6 +585,10 @@ class WindowFunctionTests(TestCase):
             ('Brown', 'Sales', 53000, datetime.date(2009, 9, 1), 148000)
         ], transform=lambda row: (row.name, row.department, row.salary, row.hire_date, row.sum))
 
+    @skipIf(
+        connection.vendor == 'sqlite' and connection.Database.sqlite_version_info < (3, 27),
+        'Nondeterministic failure on SQLite < 3.27.'
+    )
     def test_subquery_row_range_rank(self):
         qs = Employee.objects.annotate(
             highest_avg_salary_date=Subquery(