MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_basic

Method test_basic

test/ext/test_associationproxy.py:963–979  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

961 collection_class = ObjectCollection
962
963 def test_basic(self):
964 Parent = self.classes.Parent
965
966 self.session = fixture_session()
967
968 p = Parent("p1")
969 self.assert_(len(list(p.children)) == 0)
970
971 p.children.append("child")
972 self.assert_(len(list(p.children)) == 1)
973
974 p = self.roundtrip(p)
975 self.assert_(len(list(p.children)) == 1)
976
977 # We didn't provide an alternate _AssociationList implementation
978 # for our ObjectCollection, so indexing will fail.
979 assert_raises(TypeError, p.children.__getitem__, 1)
980
981
982class ProxyFactoryTest(ListTest):

Callers

nothing calls this directly

Calls 6

fixture_sessionFunction · 0.90
assert_raisesFunction · 0.90
ParentClass · 0.70
assert_Method · 0.45
appendMethod · 0.45
roundtripMethod · 0.45

Tested by

no test coverage detected