summaryrefslogtreecommitdiff
path: root/tests/backends
diff options
context:
space:
mode:
Diffstat (limited to 'tests/backends')
-rw-r--r--tests/backends/base/test_operations.py33
1 files changed, 17 insertions, 16 deletions
diff --git a/tests/backends/base/test_operations.py b/tests/backends/base/test_operations.py
index 7ca0535135..607afb6dfc 100644
--- a/tests/backends/base/test_operations.py
+++ b/tests/backends/base/test_operations.py
@@ -15,12 +15,6 @@ class SimpleDatabaseOperationTests(SimpleTestCase):
def setUp(self):
self.ops = BaseDatabaseOperations(connection=connection)
- @skipIfDBFeature('can_distinct_on_fields')
- def test_distinct_on_fields(self):
- msg = 'DISTINCT ON fields is not supported by this database backend'
- with self.assertRaisesMessage(NotSupportedError, msg):
- self.ops.distinct_sql(['a', 'b'], None)
-
def test_deferrable_sql(self):
self.assertEqual(self.ops.deferrable_sql(), '')
@@ -123,6 +117,23 @@ class SimpleDatabaseOperationTests(SimpleTestCase):
with self.assertRaisesMessage(NotImplementedError, self.may_requre_msg % 'datetime_extract_sql'):
self.ops.datetime_extract_sql(None, None, None)
+
+class DatabaseOperationTests(TestCase):
+ def setUp(self):
+ self.ops = BaseDatabaseOperations(connection=connection)
+
+ @skipIfDBFeature('supports_over_clause')
+ def test_window_frame_raise_not_supported_error(self):
+ msg = 'This backend does not support window expressions.'
+ with self.assertRaisesMessage(NotSupportedError, msg):
+ self.ops.window_frame_rows_start_end()
+
+ @skipIfDBFeature('can_distinct_on_fields')
+ def test_distinct_on_fields(self):
+ msg = 'DISTINCT ON fields is not supported by this database backend'
+ with self.assertRaisesMessage(NotSupportedError, msg):
+ self.ops.distinct_sql(['a', 'b'], None)
+
@skipIfDBFeature('supports_temporal_subtraction')
def test_subtract_temporals(self):
duration_field = DurationField()
@@ -133,13 +144,3 @@ class SimpleDatabaseOperationTests(SimpleTestCase):
)
with self.assertRaisesMessage(NotSupportedError, msg):
self.ops.subtract_temporals(duration_field_internal_type, None, None)
-
-
-class DatabaseOperationTests(TestCase):
- # Checking the 'supports_over_clause' feature requires a query for the
- # MySQL backend to perform a version check.
- @skipIfDBFeature('supports_over_clause')
- def test_window_frame_raise_not_supported_error(self):
- msg = 'This backend does not support window expressions.'
- with self.assertRaisesMessage(NotSupportedError, msg):
- connection.ops.window_frame_rows_start_end()