fix bug when initializing CheckConstraint
This commit is contained in:
parent
cde0f9b52d
commit
4b50def6ea
@ -147,7 +147,6 @@ class CheckConstraint(ConstraintChangeset, schema.CheckConstraint):
|
|||||||
'parameter or "columns" to autogenarate it.')
|
'parameter or "columns" to autogenarate it.')
|
||||||
colnames, table = self._normalize_columns(cols)
|
colnames, table = self._normalize_columns(cols)
|
||||||
table = kwargs.pop('table', table)
|
table = kwargs.pop('table', table)
|
||||||
ConstraintChangeset.__init__(self, *args, **kwargs)
|
|
||||||
schema.CheckConstraint.__init__(self, sqltext, *args, **kwargs)
|
schema.CheckConstraint.__init__(self, sqltext, *args, **kwargs)
|
||||||
if table is not None:
|
if table is not None:
|
||||||
self.table = table
|
self.table = table
|
||||||
|
@ -7,9 +7,9 @@ tag_svn_revision = 1
|
|||||||
tag_build = .dev
|
tag_build = .dev
|
||||||
|
|
||||||
[nosetests]
|
[nosetests]
|
||||||
pdb = true
|
#pdb = true
|
||||||
pdb-failures = true
|
#pdb-failures = true
|
||||||
stop = true
|
#stop = true
|
||||||
|
|
||||||
[aliases]
|
[aliases]
|
||||||
release = egg_info -RDb ''
|
release = egg_info -RDb ''
|
||||||
|
@ -146,8 +146,7 @@ class TestConstraint(CommonTestConstraint):
|
|||||||
@fixture.usedb(not_supported=['sqlite', 'mysql'])
|
@fixture.usedb(not_supported=['sqlite', 'mysql'])
|
||||||
def test_named_check_constraints(self):
|
def test_named_check_constraints(self):
|
||||||
"""Check constraints can be defined, created, and dropped"""
|
"""Check constraints can be defined, created, and dropped"""
|
||||||
self.assertRaises(InvalidConstraintError,
|
self.assertRaises(InvalidConstraintError, CheckConstraint, 'id > 3')
|
||||||
CheckConstraint, 'id > 3')
|
|
||||||
cons = CheckConstraint('id > 3', name="id_check", table=self.table)
|
cons = CheckConstraint('id > 3', name="id_check", table=self.table)
|
||||||
cons.create()
|
cons.create()
|
||||||
self.refresh_table()
|
self.refresh_table()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user