diff options
| author | Tim Graham <timograham@gmail.com> | 2020-01-19 18:30:54 -0500 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-01-20 20:03:35 +0100 |
| commit | 227d0c7365cfd0a64d021cb9bdcf77bed2d3f170 (patch) | |
| tree | 3d166c4ca5e98352857cf08f92ec2c1c84bb73ec /tests | |
| parent | 2a2ea4ee18fdcf2c95bf6435bc63b74623e3085b (diff) | |
Fixed #31183 -- Added a feature flag for "<db> only supports UNBOUNDED together with PRECEDING and FOLLOWING".
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/expressions_window/tests.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/expressions_window/tests.py b/tests/expressions_window/tests.py index 4df58bf27d..37b0e95247 100644 --- a/tests/expressions_window/tests.py +++ b/tests/expressions_window/tests.py @@ -1,5 +1,5 @@ import datetime -from unittest import mock, skipIf, skipUnless +from unittest import mock, skipIf from django.core.exceptions import FieldError from django.db import NotSupportedError, connection @@ -750,9 +750,9 @@ class WindowFunctionTests(TestCase): frame=RowRange(end='a'), ))) - @skipUnless(connection.vendor == 'postgresql', 'Frame construction not allowed on PostgreSQL') - def test_postgresql_illegal_range_frame_start(self): - msg = 'PostgreSQL only supports UNBOUNDED together with PRECEDING and FOLLOWING.' + @skipUnlessDBFeature('only_supports_unbounded_with_preceding_and_following') + def test_unsupported_range_frame_start(self): + msg = '%s only supports UNBOUNDED together with PRECEDING and FOLLOWING.' % connection.display_name with self.assertRaisesMessage(NotSupportedError, msg): list(Employee.objects.annotate(test=Window( expression=Sum('salary'), @@ -760,9 +760,9 @@ class WindowFunctionTests(TestCase): frame=ValueRange(start=-1), ))) - @skipUnless(connection.vendor == 'postgresql', 'Frame construction not allowed on PostgreSQL') - def test_postgresql_illegal_range_frame_end(self): - msg = 'PostgreSQL only supports UNBOUNDED together with PRECEDING and FOLLOWING.' + @skipUnlessDBFeature('only_supports_unbounded_with_preceding_and_following') + def test_unsupported_range_frame_end(self): + msg = '%s only supports UNBOUNDED together with PRECEDING and FOLLOWING.' % connection.display_name with self.assertRaisesMessage(NotSupportedError, msg): list(Employee.objects.annotate(test=Window( expression=Sum('salary'), |
