summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/backends/mysql/test_features.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/backends/mysql/test_features.py b/tests/backends/mysql/test_features.py
index 96e1ed3b49..4e5c7c294f 100644
--- a/tests/backends/mysql/test_features.py
+++ b/tests/backends/mysql/test_features.py
@@ -28,3 +28,21 @@ class TestFeatures(TestCase):
_connection.sql_mode = {"NO_AUTO_VALUE_ON_ZERO"}
database_features = DatabaseFeatures(_connection)
self.assertIs(database_features.allows_auto_pk_0, True)
+
+ def test_allows_group_by_selected_pks(self):
+ with mock.MagicMock() as _connection:
+ _connection.mysql_is_mariadb = False
+ database_features = DatabaseFeatures(_connection)
+ self.assertIs(database_features.allows_group_by_selected_pks, True)
+
+ with mock.MagicMock() as _connection:
+ _connection.mysql_is_mariadb = False
+ _connection.sql_mode = {}
+ database_features = DatabaseFeatures(_connection)
+ self.assertIs(database_features.allows_group_by_selected_pks, True)
+
+ with mock.MagicMock() as _connection:
+ _connection.mysql_is_mariadb = True
+ _connection.sql_mode = {"ONLY_FULL_GROUP_BY"}
+ database_features = DatabaseFeatures(_connection)
+ self.assertIs(database_features.allows_group_by_selected_pks, False)