diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-05-03 13:49:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-03 13:49:02 +0200 |
| commit | 8c5649bfb71f272d9fe27f61230f4cb925e72c47 (patch) | |
| tree | c29c103960f987a55a6e3c7b73bd51e1129ca93b /tests/expressions_window | |
| parent | e68361364906170db936d917ab5dd07262f537b6 (diff) | |
Fixed NonQueryWindowTests.test_unsupported_backend() on MySQL.
Diffstat (limited to 'tests/expressions_window')
| -rw-r--r-- | tests/expressions_window/tests.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/expressions_window/tests.py b/tests/expressions_window/tests.py index 129912b93a..f2ea95fa3c 100644 --- a/tests/expressions_window/tests.py +++ b/tests/expressions_window/tests.py @@ -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): |
