mirror of
https://github.com/django/django.git
synced 2024-12-22 09:05:43 +00:00
Fixed NonQueryWindowTests.test_unsupported_backend() on MySQL.
This commit is contained in:
parent
e683613649
commit
8c5649bfb7
@ -779,6 +779,14 @@ class WindowFunctionTests(TestCase):
|
||||
)))
|
||||
|
||||
|
||||
class WindowUnsupportedTests(TestCase):
|
||||
def test_unsupported_backend(self):
|
||||
msg = 'This backend does not support window expressions.'
|
||||
with mock.patch.object(connection.features, 'supports_over_clause', False):
|
||||
with self.assertRaisesMessage(NotSupportedError, msg):
|
||||
Employee.objects.annotate(dense_rank=Window(expression=DenseRank())).get()
|
||||
|
||||
|
||||
class NonQueryWindowTests(SimpleTestCase):
|
||||
def test_window_repr(self):
|
||||
self.assertEqual(
|
||||
@ -828,12 +836,6 @@ class NonQueryWindowTests(SimpleTestCase):
|
||||
with self.assertRaisesMessage(NotSupportedError, msg):
|
||||
Employee.objects.annotate(dense_rank=Window(expression=DenseRank())).filter(dense_rank__gte=1)
|
||||
|
||||
def test_unsupported_backend(self):
|
||||
msg = 'This backend does not support window expressions.'
|
||||
with mock.patch.object(connection.features, 'supports_over_clause', False):
|
||||
with self.assertRaisesMessage(NotSupportedError, msg):
|
||||
Employee.objects.annotate(dense_rank=Window(expression=DenseRank())).get()
|
||||
|
||||
def test_invalid_order_by(self):
|
||||
msg = 'order_by must be either an Expression or a sequence of expressions'
|
||||
with self.assertRaisesMessage(ValueError, msg):
|
||||
|
Loading…
Reference in New Issue
Block a user