diff options
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'), |
