Exemple #1
0
    def test_getpk_returns_single_pk_values(self):

        class A(object):
            __storm_table__ = 'A'
            id = Int(primary=True)

        a = A()
        a.id = 42
        assert_equal(getpk(a), (42,))
Exemple #2
0
    def test_getpk_returns_multi_pk_values(self):

        class A(object):
            __storm_table__ = 'A'
            id1 = Int(primary=1)
            id2 = Int(primary=2)

        a = A()
        a.id1 = 4
        a.id2 = 2
        assert_equal(getpk(a), (4, 2))