From: Mike Bayer Date: Mon, 4 Dec 2017 21:40:20 +0000 (-0500) Subject: Add tests for ARRAY propagate events re. MutableList X-Git-Tag: rel_1_1_16~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0be865d7bda108d501479dc4d62f42adba2a6b0e;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Add tests for ARRAY propagate events re. MutableList 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) --- diff --git a/test/ext/test_mutable.py b/test/ext/test_mutable.py index 23bccafe92..e0b98b8665 100644 --- a/test/ext/test_mutable.py +++ b/test/ext/test_mutable.py @@ -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):