]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Add tests for ARRAY propagate events re. MutableList
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 4 Dec 2017 21:40:20 +0000 (16:40 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 4 Dec 2017 22:42:04 +0000 (17:42 -0500)
Issue #4141 appears in version 1.2, however we are adding the
MutableList test for it to 1.1 as well.  The metadata test
does not apply as in 1.1 ARRAY is not a SchemaEventTarget.

Change-Id: If8c57615860883837f6cf72661e46180a77778c1
(cherry picked from commit 14bb6eae364f41b6acbce782ebf5f984b9364af9)

test/ext/test_mutable.py

index 23bccafe9298fcf1602ab2cc8de5b8b1fdba0f7a..e0b98b8665628ba9385f46c6c32dc0fee728482d 100644 (file)
@@ -770,6 +770,26 @@ class MutableColumnCopyJSONTest(_MutableDictTestBase, fixtures.MappedTest):
         self._test_non_mutable()
 
 
+class MutableColumnCopyArrayTest(_MutableListTestBase, fixtures.MappedTest):
+    __requires__ = 'array_type',
+
+    @classmethod
+    def define_tables(cls, metadata):
+        from sqlalchemy.ext.declarative import declarative_base
+        from sqlalchemy.sql.sqltypes import ARRAY
+
+        MutableList = cls._type_fixture()
+
+        Base = declarative_base(metadata=metadata)
+
+        class Mixin(object):
+            data = Column(MutableList.as_mutable(ARRAY(Integer)))
+
+        class Foo(Mixin, Base):
+            __tablename__ = 'foo'
+            id = Column(Integer, primary_key=True)
+
+
 class MutableListWithScalarPickleTest(_MutableListTestBase,
                                       fixtures.MappedTest):