From: mpv Date: Tue, 9 Apr 2019 14:57:16 +0000 (+0300) Subject: For the issue #2903 : make only latest feature become invalid because of python scrip... X-Git-Tag: V9_3_0rc1^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6a1577e598a99ab41c52ab59b9126de648208028;p=modules%2Fshaper.git For the issue #2903 : make only latest feature become invalid because of python scripts execution specifics --- diff --git a/src/Model/Model_AttributeValidator.cpp b/src/Model/Model_AttributeValidator.cpp index ab0142814..135a6a423 100644 --- a/src/Model/Model_AttributeValidator.cpp +++ b/src/Model/Model_AttributeValidator.cpp @@ -136,9 +136,13 @@ bool Model_AttributeValidator::isValid(const AttributePtr& theAttribute, continue; if (ModelAPI_Session::get()->validators()->isConcealed( aRefFeat->getKind(), (*aRR)->id())) { - theError = "Reference to concealed object %1"; - theError.arg(aRefd->data()->name()); - return false; + // check this feature is later than another referenced to make unit tests working + //because of Test1757 and others: allow to move selection context of this to next + if (aFeat->document()->isLater(aFeat, aRefFeat)) { + theError = "Reference to concealed object %1"; + theError.arg(aRefd->data()->name()); + return false; + } } } if (aCheckFeature) diff --git a/src/ModelAPI/Test/Test2903.py b/src/ModelAPI/Test/Test2903.py index b97b1e6c1..c66ce71ef 100644 --- a/src/ModelAPI/Test/Test2903.py +++ b/src/ModelAPI/Test/Test2903.py @@ -36,6 +36,6 @@ assert(aFactory.validate(Partition_1.feature())) # Modify Fuse to add sphere thatwas used in Partition Fuse_1.setMainObjects([model.selection("COMPOUND", "all-in-Box_1"), model.selection("COMPOUND", "all-in-Cylinder_1"), model.selection("COMPOUND", "all-in-Sphere_1")]) model.end() -# both fuse and partition must become invalid because both refer to the same object +# partition must become invalid because it refers to the same object as fuse assert(not aFactory.validate(Fuse_1.feature())) -assert(not aFactory.validate(Partition_1.feature())) +assert(aFactory.validate(Partition_1.feature()))