diff options
| author | MichaĆ Modzelewski <michal.modzelewski@gmail.com> | 2015-01-15 22:16:25 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-01-15 19:42:05 -0500 |
| commit | 39b58ad95ade8109de0f0ae3930e333b7f689c0f (patch) | |
| tree | bf5f765b64e5a0e7dd6a4f9db3d99c2fb4d4e550 /tests/expressions_case | |
| parent | 51dc617b21e67636d96cf645905797a4d6ff4bf0 (diff) | |
Fixed #24148 -- Documented a bug with case expressions in SQLite < 3.7.0
Diffstat (limited to 'tests/expressions_case')
| -rw-r--r-- | tests/expressions_case/tests.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/expressions_case/tests.py b/tests/expressions_case/tests.py index a344e79923..9636930e05 100644 --- a/tests/expressions_case/tests.py +++ b/tests/expressions_case/tests.py @@ -7,7 +7,7 @@ import unittest from uuid import UUID from django.core.exceptions import FieldError -from django.db import models +from django.db import connection, models from django.db.models import F, Q, Value, Min, Max from django.db.models.expressions import Case, When from django.test import TestCase @@ -254,6 +254,12 @@ class CaseExpressionTests(TestCase): transform=attrgetter('integer', 'test') ) + if connection.vendor == 'sqlite' and connection.Database.sqlite_version_info < (3, 7, 0): + # There is a bug in sqlite < 3.7.0, where placeholder order is lost. + # Thus, the above query returns <condition_value> + <result_value> + # for each matching case instead of <result_value> + 1 (#24148). + test_combined_expression = unittest.expectedFailure(test_combined_expression) + def test_in_subquery(self): self.assertQuerysetEqual( CaseTestModel.objects.filter( |
