369 |
369 |
370 def test_update_constraint(self): |
370 def test_update_constraint(self): |
371 with self.admin_access.repo_cnx() as cnx: |
371 with self.admin_access.repo_cnx() as cnx: |
372 rdef = self.schema['Transition'].rdef('type') |
372 rdef = self.schema['Transition'].rdef('type') |
373 cstr = rdef.constraint_by_type('StaticVocabularyConstraint') |
373 cstr = rdef.constraint_by_type('StaticVocabularyConstraint') |
374 if not getattr(cstr, 'eid', None): |
|
375 # bug in schema reloading, constraint's eid not restored |
|
376 self.skipTest('start me alone') |
|
377 cnx.execute('SET X value %(v)s WHERE X eid %(x)s', |
374 cnx.execute('SET X value %(v)s WHERE X eid %(x)s', |
378 {'x': cstr.eid, 'v': u"u'normal', u'auto', u'new'"}) |
375 {'x': cstr.eid, 'v': u"u'normal', u'auto', u'new'"}) |
379 cnx.execute('INSERT CWConstraint X: X value %(value)s, X cstrtype CT, ' |
376 cnx.execute('INSERT CWConstraint X: X value %(value)s, X cstrtype CT, ' |
380 'EDEF constrained_by X WHERE CT name %(ct)s, EDEF eid %(x)s', |
377 'EDEF constrained_by X WHERE CT name %(ct)s, EDEF eid %(x)s', |
381 {'ct': 'SizeConstraint', 'value': u'max=10', 'x': rdef.eid}) |
378 {'ct': 'SizeConstraint', 'value': u'max=10', 'x': rdef.eid}) |