]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
For the issue #2903 : make only latest feature become invalid because of python scrip...
authormpv <mpv@opencascade.com>
Tue, 9 Apr 2019 14:57:16 +0000 (17:57 +0300)
committermpv <mpv@opencascade.com>
Tue, 9 Apr 2019 14:57:16 +0000 (17:57 +0300)
src/Model/Model_AttributeValidator.cpp
src/ModelAPI/Test/Test2903.py

index ab01428148b1f47f90fab019e49e2182233914a0..135a6a423332217dac18c91ccc0f5d0de5093205 100644 (file)
@@ -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)
index b97b1e6c1ffc86e51d58ba2e05c03d07e26e773c..c66ce71ef9ebf6b10dad12e7ef25586ca23be661 100644 (file)
@@ -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()))