Re: [Modeling-users] bug 841315: multiplicity constraints, [1,1]
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2003-11-13 22:34:25
|
Mario Ruggier <ma...@ru...> wrote: > thanks... Created bug 841315 for this: > "Model associations do not set the multiplicity bounds" >=20 > I have installed the patch, but there are some problems. >=20 > First, the first installation test fails: > % python ./run.py > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > FAIL: [PyModel] unqualified_relationships_with_inverse > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "test_PyModel.py", line 393, in > test_08_qualified_relationships_with_inverse > self.check_model(model) > File "test_PyModel.py", line 92, in check_model > self.failIf(fkStore.isRequired()!=3DtoStore.multiplicityLowerBound()) > File > "/BinaryCache/python/python-3.root~193/usr/lib/python2.2/unittest.py", l= ine > 258, in failIf > if expr: raise self.failureException, msg > AssertionError [...] Okay, thanks for reporting. In fact the test is right --it checks that the PyModel does what is expected, i.e. that the FK, when automatically created, is mandatory/required when the multiplicity's lower bound is 1. Since this correlation was not coded but the multiplicity is now correctly forwarded, the test now fails ;) I've attached to bug ticket #841315 the corresponding patch (it is an extension of the one I posted earlier today). That's a 2-in-1 bugfix, cool. > Then, for my model, on validation I get a warning for each > such relationship, e.g: >=20 > Object: Relationship A.b > ------------------------------- > * Warning(s): > - relationship is mandatory but source attribute A.fkBId is not req= uired Yes, this warning is "normal" in the bug context, it is due to the fact that the FK is not marked as mandatory as it should (in particular, this makes mdl_generate_DB_schema.py mark the FK as a NOT NULL column). It will disappear w/ the new patch applied. Please note: this is not integrated into cvs yet, I still need to add test for the other discovered bug --but this will be in the next release for sure. Thanks for the report, -- S=E9bastien. |