diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d74984c42..effb3faac 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,10 @@ Change Log ========== +v4.11.0 (TBD) +---------------- +* :+1: Added the `ShowScopeMembersOnly` representation on the `UserReferenceProperty`. (#1418) + v4.10.0 (5MAR24) ---------------- * :+1: Added the possibility to download, upload and reference `StoredFiles`. (#1361) diff --git a/pykechain/enums.py b/pykechain/enums.py index e49538a4e..bdfaf6688 100644 --- a/pykechain/enums.py +++ b/pykechain/enums.py @@ -758,6 +758,7 @@ class PropertyRepresentation(Enum): CAMERA_SCANNER_INPUT = "cameraScannerInput" SIGNATURE = "signature" FILE_DISPLAY = "fileDisplay" + SHOW_ONLY_SCOPE_MEMBERS = "showOnlyScopeMembers" class FileDisplayRepresentationValues(Enum): diff --git a/pykechain/models/representations/__init__.py b/pykechain/models/representations/__init__.py index dc65c10ce..f459e9718 100644 --- a/pykechain/models/representations/__init__.py +++ b/pykechain/models/representations/__init__.py @@ -17,6 +17,7 @@ StoredFilesDisplayRepresentation, ThousandsSeparator, UsePropertyNameRepresentation, + ScopeMembersOnlyRepresentation, ) AnyRepresentation = ( @@ -43,6 +44,8 @@ SignatureRepresentation, # Stored files reference properties StoredFilesDisplayRepresentation, + # User reference properties + ScopeMembersOnlyRepresentation, ) __all__ = ( diff --git a/pykechain/models/representations/component.py b/pykechain/models/representations/component.py index 2d76d5433..831503bf2 100644 --- a/pykechain/models/representations/component.py +++ b/pykechain/models/representations/component.py @@ -160,5 +160,7 @@ def _valid_object_type(representation: BaseRepresentation, obj: "Base") -> bool: return obj.type == PropertyType.ATTACHMENT_VALUE elif rtype == _AllRepresentations.FILE_DISPLAY: return obj.type == PropertyType.STOREDFILE_REFERENCES_VALUE + elif rtype == _AllRepresentations.SHOW_ONLY_SCOPE_MEMBERS: + return obj.type == PropertyType.USER_REFERENCES_VALUE else: return False diff --git a/pykechain/models/representations/representations.py b/pykechain/models/representations/representations.py index eed6165c7..88e8edbf3 100644 --- a/pykechain/models/representations/representations.py +++ b/pykechain/models/representations/representations.py @@ -302,3 +302,9 @@ def validate_representation(self, value: Any) -> None: check_enum( value, FileDisplayRepresentationValues, "file display representation values" ) + + +class ScopeMembersOnlyRepresentation(SimpleConfigValueKeyRepresentation): + """Representation for the users shown inside a `ScopeMembersReferencesProperty`.""" + + rtype = PropertyRepresentation.SHOW_ONLY_SCOPE_MEMBERS diff --git a/tests/cassettes/TestReprScopeMembersOnlyRepresentation.test_create_with_prop.json b/tests/cassettes/TestReprScopeMembersOnlyRepresentation.test_create_with_prop.json new file mode 100644 index 000000000..a4b8e0341 --- /dev/null +++ b/tests/cassettes/TestReprScopeMembersOnlyRepresentation.test_create_with_prop.json @@ -0,0 +1 @@ +{"http_interactions": [{"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "]}, "method": "GET", "uri": "/api/v3/scopes.json?status=ACTIVE&name=Bike+Project&fields=id%2Cname%2Cref%2Ctext%2Ccreated_at%2Cupdated_at%2Cstart_date%2Cdue_date%2Cstatus%2Ccategory%2Cprogress%2Cmembers%2Cteam%2Ctags%2Cscope_options%2Cteam_id_name%2Cworkflow_root_id%2Ccatalog_root_id%2Capp_root_id%2Cproduct_model_id%2Cproduct_instance_id%2Ccatalog_model_id%2Ccatalog_instance_id%2Cproject_info&limit=2"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA7VVwW7kNgz9FcPXRoEky7I9p20Xe9hD26DJ7qFFMKBleqLGtgxZnt1BMP9eypNMPEi37WF7MGBS5OMjKT8/pcbNQ0g34iod8Cu9DHPXXaWjx7118/Rie5zmLpD5x1Nqm3ST1k3eGARgkOXIVFFzVrUmZ2WRK8FbBbluU8KEHin6J/uIyY13f6IJaURrIwQ52Xh2hqV8+hyVzBM2SXBJwCkkN4dHNA9ghwSGJhnn6SGxYTl9wKSzvSVqV+kUIETK6Y/v7z5+/kAeAwF3zh/I9+n2w2/b2/e/3ix+j3TSbCFWlFxUTHAm5R0vN1xvVHldFirP8t8pdB6bdajMGM+YyO+E2uTlRqlrzrmueAwNsIsTWhoj8yubjBuRBfA7DOk9EYz21o3BuoEin1K3R+9tg7f01ODTTQvdhHFAtIAJB2roFEpj9+EwxlmaeQqu/2jcEBtxQ2t3Eaqx09jBYfHH2ZqD6SKLlf9n10QAj7u5o2LHI1E6of0Ce7tbalGp+2NcBvRb22xP+zvdgR77Gv3rHZClpvFM6J+XPM0j+r2dnH9dPL3ZaQsm2D2Zwc/UHPZgu/PZCfXcefTAALtL1wr6GYScHUJzkX28OhHLLmjFC/QC+X14nRmsab3GfZOXesMrmq+kPpGV3JH7n9jBu/p66C45ngn9y+j+A8fq7fBi7P+60b+nFaFfWIm3F+1ydLcr1zfpPbh4E6aA/ofR9hmLzb0jDVqU5dq4/vvzv49Sugja1g6ti1/XolM+bKOsvHxazYwXNuXsSADO8vvF+ce2c1+23jlCigLMBW+05oqp3NRMlUaxUuUF01mb81JqUGV7UkDo3G6V2LSoSKk5U5WWTLUVsEqVghVYywZKUSgJlAjjuErKashKhYrJohCUxDkDqsJqWbZC51nDpU4X3s1MvfakNN0psypLVQmpmKhUxZQm9awQJBOqqlQNpKgcVpl2oOkMBk/JoHmRoapZXgmgTkVGFYv4qwEtoJaQmWzV5KpsrbVQJhdM5jllSqxYmcmSKSF1gSJroChWmZdlK07AWAmGpdCUwoHVhggIrelnoXJoZZYe749/ASxW3Ws+BwAA", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:06 GMT"], "Content-Type": ["application/json"], "Transfer-Encoding": ["chunked"], "Connection": ["keep-alive"], "Vary": ["Accept-Encoding", "Accept, Accept-Language, Cookie"], "allow": ["GET, POST, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"], "Content-Encoding": ["gzip"]}, "status": {"code": 200, "message": "OK"}, "url": "/api/v3/scopes.json?status=ACTIVE&name=Bike+Project&fields=id%2Cname%2Cref%2Ctext%2Ccreated_at%2Cupdated_at%2Cstart_date%2Cdue_date%2Cstatus%2Ccategory%2Cprogress%2Cmembers%2Cteam%2Ctags%2Cscope_options%2Cteam_id_name%2Cworkflow_root_id%2Ccatalog_root_id%2Capp_root_id%2Cproduct_model_id%2Cproduct_instance_id%2Ccatalog_model_id%2Ccatalog_instance_id%2Cproject_info&limit=2"}, "recorded_at": "2024-05-08T11:59:06"}, {"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "]}, "method": "GET", "uri": "/api/v3/parts.json?name=Bike&category=MODEL&limit=2&scope_id=bd5dceaa-a35e-47b0-9fc5-875410f4a56f&fields=id%2Cname%2Cref%2Cdescription%2Ccreated_at%2Cupdated_at%2Cproperties%2Ccategory%2Cclassification%2Cparent_id%2Cmultiplicity%2Cvalue_options%2Cproperty_type%2Cvalue%2Coutput%2Corder%2Cpart_id%2Cscope_id%2Cmodel_id%2Cproxy_source_id_name%2Cunit"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA9XWWW/jNhAA4L+y0HNmwfvwS+HduG1QJ1602p4oDJIaZYV6LUGWdhME+e8dH7HTNoAd2A/1kz1DUuLwoyg9ZKnu51024BfZHO/oz7yfzS6ypsUvVd0vnuIWF/2so/CPh6wqskGGKjBlgwH6ZaA4/YsBFVgpQhKlkb7AjK4ZPiP1flf9tYxaLCmI66DARWqrpqvqOSUpkUKHt3V7T9H15HI0XqZmYbGoyoqa1t0+/Di5/Pg+p6bPNJ+qmVWp6pYjJjej6fXw5rfloBbpSsU0UDWZYNwDZyBEztyAmYHyb7lxxqrfqWvfFPu7ulXXRaobnK5qj4UuEoYAQWoEZSMDXyYNzmrFWamCNiWNaEKL8249xDunPBcKuFcelGESPAYBXHmvYhBMsLAsqi5wthrxxFDf3U8Xdd+m5b2n6+XctjXYdhU+U6EZMIyshGRiAlUGBiGKEqxjzBvGpdblTuU7DO1iy3K7if7jsrnR/bS7b5bDrm7y6c/D8cfRq83qtsA2GzBa+Hm13WtfwqzHab26I9Xy8LhJPbXv9RSccaVf8BQMGK2xyLkYSDeQ7K3XXq89SWdjc+BWfv0GeI1m3XdNT7Pu2h4fLzacPGmmnUsgbVnQ9IoEtJE40KYMwifUPhU7zrzuwuzNJ6xuP3Vb1W6ZhG1yL+6348nwSF5+al5FNR/2uAotJfPnwlsiKyVTDgRGCQqlAx+jA8c52hAI2MYd74cqdX27O0abbbwXdZjnw/ffX4+OfXDFqWWd9oofJusZ9T4XWVcWMXHJAC13oGRRAD2yHJJVTkojFKLZyV4+83vSLf6R2yucj3490lae2FYKxZ09yFaSrDybQzmhs4Y5BC9MCSp5BTEiFVXYQLZK0NR3tqO7pmqr+e2b5RpsdXGThU12r+/lMB/lV9ej44zVqY2JQR9oTO8scTYnMxZcOHq9QlmGSN9RxkAwiYNXzPDErLfM7ox/wbionul+3cZ7XcdXNz8cZ6pPbEoVMuUPMqUll9Kei6mMySCLHELgq5lpCE54sFEzFpkMIj47k38KM/xmK7qg6BDOd5PJeDS8OU7UnFpUWWle+jx+oavm1vH/u+if/44f/wZVFE16xw4AAA==", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:06 GMT"], "Content-Type": ["application/json"], "Transfer-Encoding": ["chunked"], "Connection": ["keep-alive"], "Vary": ["Accept-Encoding", "Accept, Accept-Language, Cookie"], "allow": ["GET, POST, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"], "Content-Encoding": ["gzip"]}, "status": {"code": 200, "message": "OK"}, "url": "/api/v3/parts.json?name=Bike&category=MODEL&limit=2&scope_id=bd5dceaa-a35e-47b0-9fc5-875410f4a56f&fields=id%2Cname%2Cref%2Cdescription%2Ccreated_at%2Cupdated_at%2Cproperties%2Ccategory%2Cclassification%2Cparent_id%2Cmultiplicity%2Cvalue_options%2Cproperty_type%2Cvalue%2Coutput%2Corder%2Cpart_id%2Cscope_id%2Cmodel_id%2Cproxy_source_id_name%2Cunit"}, "recorded_at": "2024-05-08T11:59:06"}, {"request": {"body": {"encoding": "utf-8", "string": "{\"name\": \"__test model for representations\", \"parent_id\": \"e4a047a6-4a00-41a6-bae4-732ac2f639de\", \"multiplicity\": \"ONE\"}"}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "], "Content-Length": ["120"], "Content-Type": ["application/json"]}, "method": "POST", "uri": "/api/v3/parts/create_child_model?fields=id%2Cname%2Cref%2Cdescription%2Ccreated_at%2Cupdated_at%2Cproperties%2Ccategory%2Cclassification%2Cparent_id%2Cmultiplicity%2Cvalue_options%2Cproperty_type%2Cvalue%2Coutput%2Corder%2Cpart_id%2Cscope_id%2Cmodel_id%2Cproxy_source_id_name%2Cunit"}, "response": {"body": {"encoding": "utf-8", "string": "{\"results\":[{\"id\":\"786e6813-46c0-4d9f-9de3-084c4963375d\",\"name\":\"__test model for representations\",\"ref\":\"test-model-for-representations\",\"description\":\"\",\"category\":\"MODEL\",\"classification\":\"PRODUCT\",\"multiplicity\":\"ONE\",\"created_at\":\"2024-05-08T11:59:06.313300Z\",\"updated_at\":\"2024-05-08T11:59:06.313305Z\",\"scope_id\":\"bd5dceaa-a35e-47b0-9fc5-875410f4a56f\",\"parent_id\":\"e4a047a6-4a00-41a6-bae4-732ac2f639de\",\"model_id\":null,\"proxy_source_id_name\":null,\"properties\":[],\"output\":true}]}"}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:06 GMT"], "Content-Type": ["application/json"], "Content-Length": ["485"], "Connection": ["keep-alive"], "vary": ["Accept, Accept-Language, Cookie"], "allow": ["POST, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"]}, "status": {"code": 201, "message": "Created"}, "url": "/api/v3/parts/create_child_model?fields=id%2Cname%2Cref%2Cdescription%2Ccreated_at%2Cupdated_at%2Cproperties%2Ccategory%2Cclassification%2Cparent_id%2Cmultiplicity%2Cvalue_options%2Cproperty_type%2Cvalue%2Coutput%2Corder%2Cpart_id%2Cscope_id%2Cmodel_id%2Cproxy_source_id_name%2Cunit"}, "recorded_at": "2024-05-08T11:59:06"}, {"request": {"body": {"encoding": "utf-8", "string": "{\"name\": \"__test object for representations\", \"part_id\": \"786e6813-46c0-4d9f-9de3-084c4963375d\", \"description\": \"\", \"property_type\": \"USER_REFERENCES_VALUE\", \"value\": null, \"unit\": \"\", \"value_options\": {}}"}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "], "Content-Length": ["205"], "Content-Type": ["application/json"]}, "method": "POST", "uri": "/api/v3/properties/create_model?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "response": {"body": {"encoding": "utf-8", "string": "{\"results\":[{\"id\":\"9c13623e-7814-473c-bdc8-549322a2af12\",\"name\":\"__test object for representations\",\"ref\":\"test-object-for-representations\",\"description\":\"\",\"property_type\":\"USER_REFERENCES_VALUE\",\"category\":\"MODEL\",\"order\":0,\"unit\":\"\",\"value_options\":{},\"value\":[],\"created_at\":\"2024-05-08T11:59:06.630263Z\",\"updated_at\":\"2024-05-08T11:59:06.640645Z\",\"part_id\":\"786e6813-46c0-4d9f-9de3-084c4963375d\",\"scope_id\":\"bd5dceaa-a35e-47b0-9fc5-875410f4a56f\",\"model_id\":null,\"output\":true}]}"}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:06 GMT"], "Content-Type": ["application/json"], "Content-Length": ["483"], "Connection": ["keep-alive"], "vary": ["Accept, Accept-Language, Cookie"], "allow": ["POST, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"]}, "status": {"code": 201, "message": "Created"}, "url": "/api/v3/properties/create_model?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "recorded_at": "2024-05-08T11:59:06"}, {"request": {"body": {"encoding": "utf-8", "string": "{\"value_options\": {\"representations\": [{\"rtype\": \"showOnlyScopeMembers\", \"config\": {}}]}, \"id\": \"9c13623e-7814-473c-bdc8-549322a2af12\"}"}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "], "Content-Length": ["135"], "Content-Type": ["application/json"]}, "method": "PUT", "uri": "/api/v3/properties/9c13623e-7814-473c-bdc8-549322a2af12.json?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA32RyU7DMBCGX6XyGSPHW5YbgnBikVrgAEKRY09KUBpbjgOqqr47E8oJJI4ef//i8YFEmOYhTaR6OZDekYqUNhOaC6B5kUkqc2Fp62xBlSwF54abLuPkjIxmB0g3TYIprXz7DjatOh9XEQJ6wphM6v04IRqhQ3Lh6ImjyNG/nIPJxj4sR+RxEKIPENO+SfuwhD1u6nWzrq/rdX13WW+ap4ubxxo5axJsfdwjcnt/Vd/gyEcHkVTsjMxjn052H2aYofHhlFcdyO8Kyw7iT9b05j/vx2G/sdjhFnYtxKWj9WPXb1F8PL4efyxR94o3EbCGa8ySxhmXlCnKiocsq1RZMX2uBeNaPKPJHNx/aH7OMpVztqDBxNR8/0teaNBFJqjUllHpyo6WDgTqpJWlFiJXDgXT0vekaJ1yFoyhRijAn2wZLTuraJErmbFOGqU7VOy8g+FbMc7DgKubU5ixWYoz4CO/AKfzFEkjAgAA", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:07 GMT"], "Content-Type": ["application/json"], "Transfer-Encoding": ["chunked"], "Connection": ["keep-alive"], "Vary": ["Accept-Encoding", "Accept, Accept-Language, Cookie"], "allow": ["GET, PUT, PATCH, DELETE, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"], "Content-Encoding": ["gzip"]}, "status": {"code": 200, "message": "OK"}, "url": "/api/v3/properties/9c13623e-7814-473c-bdc8-549322a2af12.json?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "recorded_at": "2024-05-08T11:59:07"}, {"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "], "Content-Length": ["0"]}, "method": "DELETE", "uri": "/api/v3/parts/786e6813-46c0-4d9f-9de3-084c4963375d.json"}, "response": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:07 GMT"], "Content-Type": ["application/json"], "Content-Length": ["14"], "Connection": ["keep-alive"], "vary": ["Accept, Accept-Language, Cookie"], "allow": ["GET, PUT, PATCH, DELETE, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"]}, "status": {"code": 204, "message": "No Content"}, "url": "/api/v3/parts/786e6813-46c0-4d9f-9de3-084c4963375d.json"}, "recorded_at": "2024-05-08T11:59:07"}, {"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "], "Content-Length": ["0"]}, "method": "DELETE", "uri": "/api/v3/properties/9c13623e-7814-473c-bdc8-549322a2af12.json"}, "response": {"body": {"encoding": "utf-8", "string": "{\"results\":[{\"detail\":\"Not found.\"}]}"}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:07 GMT"], "Content-Type": ["application/json"], "Content-Length": ["37"], "Connection": ["keep-alive"], "vary": ["Accept, Accept-Language, Cookie"], "allow": ["GET, PUT, PATCH, DELETE, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"]}, "status": {"code": 404, "message": "Not Found"}, "url": "/api/v3/properties/9c13623e-7814-473c-bdc8-549322a2af12.json"}, "recorded_at": "2024-05-08T11:59:07"}], "recorded_with": "betamax/0.9.0"} \ No newline at end of file diff --git a/tests/cassettes/TestReprScopeMembersOnlyRepresentation.test_get_set.json b/tests/cassettes/TestReprScopeMembersOnlyRepresentation.test_get_set.json new file mode 100644 index 000000000..d924b979c --- /dev/null +++ b/tests/cassettes/TestReprScopeMembersOnlyRepresentation.test_get_set.json @@ -0,0 +1 @@ +{"http_interactions": [{"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "]}, "method": "GET", "uri": "/api/v3/scopes.json?status=ACTIVE&name=Bike+Project&fields=id%2Cname%2Cref%2Ctext%2Ccreated_at%2Cupdated_at%2Cstart_date%2Cdue_date%2Cstatus%2Ccategory%2Cprogress%2Cmembers%2Cteam%2Ctags%2Cscope_options%2Cteam_id_name%2Cworkflow_root_id%2Ccatalog_root_id%2Capp_root_id%2Cproduct_model_id%2Cproduct_instance_id%2Ccatalog_model_id%2Ccatalog_instance_id%2Cproject_info&limit=2"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA7VVwW7kNgz9FcPXRoEky7I9p20Xe9hD26DJ7qFFMKBleqLGtgxZnt1BMP9eypNMPEi37WF7MGBS5OMjKT8/pcbNQ0g34iod8Cu9DHPXXaWjx7118/Rie5zmLpD5x1Nqm3ST1k3eGARgkOXIVFFzVrUmZ2WRK8FbBbluU8KEHin6J/uIyY13f6IJaURrIwQ52Xh2hqV8+hyVzBM2SXBJwCkkN4dHNA9ghwSGJhnn6SGxYTl9wKSzvSVqV+kUIETK6Y/v7z5+/kAeAwF3zh/I9+n2w2/b2/e/3ix+j3TSbCFWlFxUTHAm5R0vN1xvVHldFirP8t8pdB6bdajMGM+YyO+E2uTlRqlrzrmueAwNsIsTWhoj8yubjBuRBfA7DOk9EYz21o3BuoEin1K3R+9tg7f01ODTTQvdhHFAtIAJB2roFEpj9+EwxlmaeQqu/2jcEBtxQ2t3Eaqx09jBYfHH2ZqD6SKLlf9n10QAj7u5o2LHI1E6of0Ce7tbalGp+2NcBvRb22xP+zvdgR77Gv3rHZClpvFM6J+XPM0j+r2dnH9dPL3ZaQsm2D2Zwc/UHPZgu/PZCfXcefTAALtL1wr6GYScHUJzkX28OhHLLmjFC/QC+X14nRmsab3GfZOXesMrmq+kPpGV3JH7n9jBu/p66C45ngn9y+j+A8fq7fBi7P+60b+nFaFfWIm3F+1ydLcr1zfpPbh4E6aA/ofR9hmLzb0jDVqU5dq4/vvzv49Sugja1g6ti1/XolM+bKOsvHxazYwXNuXsSADO8vvF+ce2c1+23jlCigLMBW+05oqp3NRMlUaxUuUF01mb81JqUGV7UkDo3G6V2LSoSKk5U5WWTLUVsEqVghVYywZKUSgJlAjjuErKashKhYrJohCUxDkDqsJqWbZC51nDpU4X3s1MvfakNN0psypLVQmpmKhUxZQm9awQJBOqqlQNpKgcVpl2oOkMBk/JoHmRoapZXgmgTkVGFYv4qwEtoJaQmWzV5KpsrbVQJhdM5jllSqxYmcmSKSF1gSJroChWmZdlK07AWAmGpdCUwoHVhggIrelnoXJoZZYe749/ASxW3Ws+BwAA", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:08 GMT"], "Content-Type": ["application/json"], "Transfer-Encoding": ["chunked"], "Connection": ["keep-alive"], "Vary": ["Accept-Encoding", "Accept, Accept-Language, Cookie"], "allow": ["GET, POST, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"], "Content-Encoding": ["gzip"]}, "status": {"code": 200, "message": "OK"}, "url": "/api/v3/scopes.json?status=ACTIVE&name=Bike+Project&fields=id%2Cname%2Cref%2Ctext%2Ccreated_at%2Cupdated_at%2Cstart_date%2Cdue_date%2Cstatus%2Ccategory%2Cprogress%2Cmembers%2Cteam%2Ctags%2Cscope_options%2Cteam_id_name%2Cworkflow_root_id%2Ccatalog_root_id%2Capp_root_id%2Cproduct_model_id%2Cproduct_instance_id%2Ccatalog_model_id%2Ccatalog_instance_id%2Cproject_info&limit=2"}, "recorded_at": "2024-05-08T11:59:08"}, {"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "]}, "method": "GET", "uri": "/api/v3/parts.json?name=Bike&category=MODEL&limit=2&scope_id=bd5dceaa-a35e-47b0-9fc5-875410f4a56f&fields=id%2Cname%2Cref%2Cdescription%2Ccreated_at%2Cupdated_at%2Cproperties%2Ccategory%2Cclassification%2Cparent_id%2Cmultiplicity%2Cvalue_options%2Cproperty_type%2Cvalue%2Coutput%2Corder%2Cpart_id%2Cscope_id%2Cmodel_id%2Cproxy_source_id_name%2Cunit"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA9XWWW/jNhAA4L+y0HNmwfvwS+HduG1QJ1602p4oDJIaZYV6LUGWdhME+e8dH7HTNoAd2A/1kz1DUuLwoyg9ZKnu51024BfZHO/oz7yfzS6ypsUvVd0vnuIWF/2so/CPh6wqskGGKjBlgwH6ZaA4/YsBFVgpQhKlkb7AjK4ZPiP1flf9tYxaLCmI66DARWqrpqvqOSUpkUKHt3V7T9H15HI0XqZmYbGoyoqa1t0+/Di5/Pg+p6bPNJ+qmVWp6pYjJjej6fXw5rfloBbpSsU0UDWZYNwDZyBEztyAmYHyb7lxxqrfqWvfFPu7ulXXRaobnK5qj4UuEoYAQWoEZSMDXyYNzmrFWamCNiWNaEKL8249xDunPBcKuFcelGESPAYBXHmvYhBMsLAsqi5wthrxxFDf3U8Xdd+m5b2n6+XctjXYdhU+U6EZMIyshGRiAlUGBiGKEqxjzBvGpdblTuU7DO1iy3K7if7jsrnR/bS7b5bDrm7y6c/D8cfRq83qtsA2GzBa+Hm13WtfwqzHab26I9Xy8LhJPbXv9RSccaVf8BQMGK2xyLkYSDeQ7K3XXq89SWdjc+BWfv0GeI1m3XdNT7Pu2h4fLzacPGmmnUsgbVnQ9IoEtJE40KYMwifUPhU7zrzuwuzNJ6xuP3Vb1W6ZhG1yL+6348nwSF5+al5FNR/2uAotJfPnwlsiKyVTDgRGCQqlAx+jA8c52hAI2MYd74cqdX27O0abbbwXdZjnw/ffX4+OfXDFqWWd9oofJusZ9T4XWVcWMXHJAC13oGRRAD2yHJJVTkojFKLZyV4+83vSLf6R2yucj3490lae2FYKxZ09yFaSrDybQzmhs4Y5BC9MCSp5BTEiFVXYQLZK0NR3tqO7pmqr+e2b5RpsdXGThU12r+/lMB/lV9ej44zVqY2JQR9oTO8scTYnMxZcOHq9QlmGSN9RxkAwiYNXzPDErLfM7ox/wbionul+3cZ7XcdXNz8cZ6pPbEoVMuUPMqUll9Kei6mMySCLHELgq5lpCE54sFEzFpkMIj47k38KM/xmK7qg6BDOd5PJeDS8OU7UnFpUWWle+jx+oavm1vH/u+if/44f/wZVFE16xw4AAA==", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:08 GMT"], "Content-Type": ["application/json"], "Transfer-Encoding": ["chunked"], "Connection": ["keep-alive"], "Vary": ["Accept-Encoding", "Accept, Accept-Language, Cookie"], "allow": ["GET, POST, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"], "Content-Encoding": ["gzip"]}, "status": {"code": 200, "message": "OK"}, "url": "/api/v3/parts.json?name=Bike&category=MODEL&limit=2&scope_id=bd5dceaa-a35e-47b0-9fc5-875410f4a56f&fields=id%2Cname%2Cref%2Cdescription%2Ccreated_at%2Cupdated_at%2Cproperties%2Ccategory%2Cclassification%2Cparent_id%2Cmultiplicity%2Cvalue_options%2Cproperty_type%2Cvalue%2Coutput%2Corder%2Cpart_id%2Cscope_id%2Cmodel_id%2Cproxy_source_id_name%2Cunit"}, "recorded_at": "2024-05-08T11:59:08"}, {"request": {"body": {"encoding": "utf-8", "string": "{\"name\": \"__test model for representations\", \"parent_id\": \"e4a047a6-4a00-41a6-bae4-732ac2f639de\", \"multiplicity\": \"ONE\"}"}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "], "Content-Length": ["120"], "Content-Type": ["application/json"]}, "method": "POST", "uri": "/api/v3/parts/create_child_model?fields=id%2Cname%2Cref%2Cdescription%2Ccreated_at%2Cupdated_at%2Cproperties%2Ccategory%2Cclassification%2Cparent_id%2Cmultiplicity%2Cvalue_options%2Cproperty_type%2Cvalue%2Coutput%2Corder%2Cpart_id%2Cscope_id%2Cmodel_id%2Cproxy_source_id_name%2Cunit"}, "response": {"body": {"encoding": "utf-8", "string": "{\"results\":[{\"id\":\"42c32720-776d-4b40-851c-b944816710f8\",\"name\":\"__test model for representations\",\"ref\":\"test-model-for-representations\",\"description\":\"\",\"category\":\"MODEL\",\"classification\":\"PRODUCT\",\"multiplicity\":\"ONE\",\"created_at\":\"2024-05-08T11:59:08.376707Z\",\"updated_at\":\"2024-05-08T11:59:08.376712Z\",\"scope_id\":\"bd5dceaa-a35e-47b0-9fc5-875410f4a56f\",\"parent_id\":\"e4a047a6-4a00-41a6-bae4-732ac2f639de\",\"model_id\":null,\"proxy_source_id_name\":null,\"properties\":[],\"output\":true}]}"}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:08 GMT"], "Content-Type": ["application/json"], "Content-Length": ["485"], "Connection": ["keep-alive"], "vary": ["Accept, Accept-Language, Cookie"], "allow": ["POST, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"]}, "status": {"code": 201, "message": "Created"}, "url": "/api/v3/parts/create_child_model?fields=id%2Cname%2Cref%2Cdescription%2Ccreated_at%2Cupdated_at%2Cproperties%2Ccategory%2Cclassification%2Cparent_id%2Cmultiplicity%2Cvalue_options%2Cproperty_type%2Cvalue%2Coutput%2Corder%2Cpart_id%2Cscope_id%2Cmodel_id%2Cproxy_source_id_name%2Cunit"}, "recorded_at": "2024-05-08T11:59:08"}, {"request": {"body": {"encoding": "utf-8", "string": "{\"name\": \"__test object for representations\", \"part_id\": \"42c32720-776d-4b40-851c-b944816710f8\", \"description\": \"\", \"property_type\": \"USER_REFERENCES_VALUE\", \"value\": null, \"unit\": \"\", \"value_options\": {}}"}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "], "Content-Length": ["205"], "Content-Type": ["application/json"]}, "method": "POST", "uri": "/api/v3/properties/create_model?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "response": {"body": {"encoding": "utf-8", "string": "{\"results\":[{\"id\":\"dd5fa0eb-3f9a-462b-9b43-9ca8b2054bb5\",\"name\":\"__test object for representations\",\"ref\":\"test-object-for-representations\",\"description\":\"\",\"property_type\":\"USER_REFERENCES_VALUE\",\"category\":\"MODEL\",\"order\":0,\"unit\":\"\",\"value_options\":{},\"value\":[],\"created_at\":\"2024-05-08T11:59:08.692268Z\",\"updated_at\":\"2024-05-08T11:59:08.706070Z\",\"part_id\":\"42c32720-776d-4b40-851c-b944816710f8\",\"scope_id\":\"bd5dceaa-a35e-47b0-9fc5-875410f4a56f\",\"model_id\":null,\"output\":true}]}"}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:08 GMT"], "Content-Type": ["application/json"], "Content-Length": ["483"], "Connection": ["keep-alive"], "vary": ["Accept, Accept-Language, Cookie"], "allow": ["POST, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"]}, "status": {"code": 201, "message": "Created"}, "url": "/api/v3/properties/create_model?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "recorded_at": "2024-05-08T11:59:08"}, {"request": {"body": {"encoding": "utf-8", "string": "{\"value_options\": {\"representations\": [{\"rtype\": \"showOnlyScopeMembers\", \"config\": {}}]}, \"id\": \"dd5fa0eb-3f9a-462b-9b43-9ca8b2054bb5\"}"}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "], "Content-Length": ["135"], "Content-Type": ["application/json"]}, "method": "PUT", "uri": "/api/v3/properties/dd5fa0eb-3f9a-462b-9b43-9ca8b2054bb5.json?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA32RTWvcMBCG/8qicybIsmRbvpXGPSUN7DY9NASjj3Hi4rWELLcsy/73jrM5tdCjRs/7odGZJVzWKS+sfT6z0bOWea8Gw9FCOWgDshIWtJUlaGcaK7iS1ip2w2ZzRKL7PuOSd8H+RJd3Q0i7hJE8cc4mj2FeCE04ELlxcOWAOPiX87i4NMbtSDwNYgoRUz71+RS3sKdDt+/33Zdu33393B3675/unzrinMn4GtKJkIfHu+6eRiF5TKzlN2ydx3y1+2WmFfsQr3ntmf1dYdtB+sha3sLvx3k6HRx1eMCjxbR1dGEexlcSXy4vlw9L0r3QTUKq4XuzpQkuJHAFvPlWFK3SLW9uKy1E1fwgkzX6/6H6tih1VZcbGk3K/fu/SOFKUQsOdV15kFZyaFThwGopm6KqCz40JFi2vleF9co7NAZMqRBkbTnowSloaiWJlkZVAymOweP0rpjXaaLVrTmu1CynFemRfwD6rx+UIwIAAA==", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:09 GMT"], "Content-Type": ["application/json"], "Transfer-Encoding": ["chunked"], "Connection": ["keep-alive"], "Vary": ["Accept-Encoding", "Accept, Accept-Language, Cookie"], "allow": ["GET, PUT, PATCH, DELETE, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"], "Content-Encoding": ["gzip"]}, "status": {"code": 200, "message": "OK"}, "url": "/api/v3/properties/dd5fa0eb-3f9a-462b-9b43-9ca8b2054bb5.json?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "recorded_at": "2024-05-08T11:59:09"}, {"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "]}, "method": "GET", "uri": "/api/v3/properties/dd5fa0eb-3f9a-462b-9b43-9ca8b2054bb5.json?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA32RTWvcMBCG/8qicybIsmRbvpXGPSUN7DY9NASjj3Hi4rWELLcsy/73jrM5tdCjRs/7odGZJVzWKS+sfT6z0bOWea8Gw9FCOWgDshIWtJUlaGcaK7iS1ip2w2ZzRKL7PuOSd8H+RJd3Q0i7hJE8cc4mj2FeCE04ELlxcOWAOPiX87i4NMbtSDwNYgoRUz71+RS3sKdDt+/33Zdu33393B3675/unzrinMn4GtKJkIfHu+6eRiF5TKzlN2ydx3y1+2WmFfsQr3ntmf1dYdtB+sha3sLvx3k6HRx1eMCjxbR1dGEexlcSXy4vlw9L0r3QTUKq4XuzpQkuJHAFvPlWFK3SLW9uKy1E1fwgkzX6/6H6tih1VZcbGk3K/fu/SOFKUQsOdV15kFZyaFThwGopm6KqCz40JFi2vleF9co7NAZMqRBkbTnowSloaiWJlkZVAymOweP0rpjXaaLVrTmu1CynFemRfwD6rx+UIwIAAA==", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:09 GMT"], "Content-Type": ["application/json"], "Transfer-Encoding": ["chunked"], "Connection": ["keep-alive"], "Vary": ["Accept-Encoding", "Accept, Accept-Language, Cookie"], "allow": ["GET, PUT, PATCH, DELETE, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"], "Content-Encoding": ["gzip"]}, "status": {"code": 200, "message": "OK"}, "url": "/api/v3/properties/dd5fa0eb-3f9a-462b-9b43-9ca8b2054bb5.json?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "recorded_at": "2024-05-08T11:59:09"}, {"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "], "Content-Length": ["0"]}, "method": "DELETE", "uri": "/api/v3/parts/42c32720-776d-4b40-851c-b944816710f8.json"}, "response": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:09 GMT"], "Content-Type": ["application/json"], "Content-Length": ["14"], "Connection": ["keep-alive"], "vary": ["Accept, Accept-Language, Cookie"], "allow": ["GET, PUT, PATCH, DELETE, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"]}, "status": {"code": 204, "message": "No Content"}, "url": "/api/v3/parts/42c32720-776d-4b40-851c-b944816710f8.json"}, "recorded_at": "2024-05-08T11:59:09"}, {"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "], "Content-Length": ["0"]}, "method": "DELETE", "uri": "/api/v3/properties/dd5fa0eb-3f9a-462b-9b43-9ca8b2054bb5.json"}, "response": {"body": {"encoding": "utf-8", "string": "{\"results\":[{\"detail\":\"Not found.\"}]}"}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:10 GMT"], "Content-Type": ["application/json"], "Content-Length": ["37"], "Connection": ["keep-alive"], "vary": ["Accept, Accept-Language, Cookie"], "allow": ["GET, PUT, PATCH, DELETE, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"]}, "status": {"code": 404, "message": "Not Found"}, "url": "/api/v3/properties/dd5fa0eb-3f9a-462b-9b43-9ca8b2054bb5.json"}, "recorded_at": "2024-05-08T11:59:09"}], "recorded_with": "betamax/0.9.0"} \ No newline at end of file diff --git a/tests/cassettes/TestReprScopeMembersOnlyRepresentation.test_set_value.json b/tests/cassettes/TestReprScopeMembersOnlyRepresentation.test_set_value.json new file mode 100644 index 000000000..6acb0da9c --- /dev/null +++ b/tests/cassettes/TestReprScopeMembersOnlyRepresentation.test_set_value.json @@ -0,0 +1 @@ +{"http_interactions": [{"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "]}, "method": "GET", "uri": "/api/v3/scopes.json?status=ACTIVE&name=Bike+Project&fields=id%2Cname%2Cref%2Ctext%2Ccreated_at%2Cupdated_at%2Cstart_date%2Cdue_date%2Cstatus%2Ccategory%2Cprogress%2Cmembers%2Cteam%2Ctags%2Cscope_options%2Cteam_id_name%2Cworkflow_root_id%2Ccatalog_root_id%2Capp_root_id%2Cproduct_model_id%2Cproduct_instance_id%2Ccatalog_model_id%2Ccatalog_instance_id%2Cproject_info&limit=2"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA7VVwW7kNgz9FcPXRoEky7I9p20Xe9hD26DJ7qFFMKBleqLGtgxZnt1BMP9eypNMPEi37WF7MGBS5OMjKT8/pcbNQ0g34iod8Cu9DHPXXaWjx7118/Rie5zmLpD5x1Nqm3ST1k3eGARgkOXIVFFzVrUmZ2WRK8FbBbluU8KEHin6J/uIyY13f6IJaURrIwQ52Xh2hqV8+hyVzBM2SXBJwCkkN4dHNA9ghwSGJhnn6SGxYTl9wKSzvSVqV+kUIETK6Y/v7z5+/kAeAwF3zh/I9+n2w2/b2/e/3ix+j3TSbCFWlFxUTHAm5R0vN1xvVHldFirP8t8pdB6bdajMGM+YyO+E2uTlRqlrzrmueAwNsIsTWhoj8yubjBuRBfA7DOk9EYz21o3BuoEin1K3R+9tg7f01ODTTQvdhHFAtIAJB2roFEpj9+EwxlmaeQqu/2jcEBtxQ2t3Eaqx09jBYfHH2ZqD6SKLlf9n10QAj7u5o2LHI1E6of0Ce7tbalGp+2NcBvRb22xP+zvdgR77Gv3rHZClpvFM6J+XPM0j+r2dnH9dPL3ZaQsm2D2Zwc/UHPZgu/PZCfXcefTAALtL1wr6GYScHUJzkX28OhHLLmjFC/QC+X14nRmsab3GfZOXesMrmq+kPpGV3JH7n9jBu/p66C45ngn9y+j+A8fq7fBi7P+60b+nFaFfWIm3F+1ydLcr1zfpPbh4E6aA/ofR9hmLzb0jDVqU5dq4/vvzv49Sugja1g6ti1/XolM+bKOsvHxazYwXNuXsSADO8vvF+ce2c1+23jlCigLMBW+05oqp3NRMlUaxUuUF01mb81JqUGV7UkDo3G6V2LSoSKk5U5WWTLUVsEqVghVYywZKUSgJlAjjuErKashKhYrJohCUxDkDqsJqWbZC51nDpU4X3s1MvfakNN0psypLVQmpmKhUxZQm9awQJBOqqlQNpKgcVpl2oOkMBk/JoHmRoapZXgmgTkVGFYv4qwEtoJaQmWzV5KpsrbVQJhdM5jllSqxYmcmSKSF1gSJroChWmZdlK07AWAmGpdCUwoHVhggIrelnoXJoZZYe749/ASxW3Ws+BwAA", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:10 GMT"], "Content-Type": ["application/json"], "Transfer-Encoding": ["chunked"], "Connection": ["keep-alive"], "Vary": ["Accept-Encoding", "Accept, Accept-Language, Cookie"], "allow": ["GET, POST, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"], "Content-Encoding": ["gzip"]}, "status": {"code": 200, "message": "OK"}, "url": "/api/v3/scopes.json?status=ACTIVE&name=Bike+Project&fields=id%2Cname%2Cref%2Ctext%2Ccreated_at%2Cupdated_at%2Cstart_date%2Cdue_date%2Cstatus%2Ccategory%2Cprogress%2Cmembers%2Cteam%2Ctags%2Cscope_options%2Cteam_id_name%2Cworkflow_root_id%2Ccatalog_root_id%2Capp_root_id%2Cproduct_model_id%2Cproduct_instance_id%2Ccatalog_model_id%2Ccatalog_instance_id%2Cproject_info&limit=2"}, "recorded_at": "2024-05-08T11:59:10"}, {"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "]}, "method": "GET", "uri": "/api/v3/parts.json?name=Bike&category=MODEL&limit=2&scope_id=bd5dceaa-a35e-47b0-9fc5-875410f4a56f&fields=id%2Cname%2Cref%2Cdescription%2Ccreated_at%2Cupdated_at%2Cproperties%2Ccategory%2Cclassification%2Cparent_id%2Cmultiplicity%2Cvalue_options%2Cproperty_type%2Cvalue%2Coutput%2Corder%2Cpart_id%2Cscope_id%2Cmodel_id%2Cproxy_source_id_name%2Cunit"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA9XWWW/jNhAA4L+y0HNmwfvwS+HduG1QJ1602p4oDJIaZYV6LUGWdhME+e8dH7HTNoAd2A/1kz1DUuLwoyg9ZKnu51024BfZHO/oz7yfzS6ypsUvVd0vnuIWF/2so/CPh6wqskGGKjBlgwH6ZaA4/YsBFVgpQhKlkb7AjK4ZPiP1flf9tYxaLCmI66DARWqrpqvqOSUpkUKHt3V7T9H15HI0XqZmYbGoyoqa1t0+/Di5/Pg+p6bPNJ+qmVWp6pYjJjej6fXw5rfloBbpSsU0UDWZYNwDZyBEztyAmYHyb7lxxqrfqWvfFPu7ulXXRaobnK5qj4UuEoYAQWoEZSMDXyYNzmrFWamCNiWNaEKL8249xDunPBcKuFcelGESPAYBXHmvYhBMsLAsqi5wthrxxFDf3U8Xdd+m5b2n6+XctjXYdhU+U6EZMIyshGRiAlUGBiGKEqxjzBvGpdblTuU7DO1iy3K7if7jsrnR/bS7b5bDrm7y6c/D8cfRq83qtsA2GzBa+Hm13WtfwqzHab26I9Xy8LhJPbXv9RSccaVf8BQMGK2xyLkYSDeQ7K3XXq89SWdjc+BWfv0GeI1m3XdNT7Pu2h4fLzacPGmmnUsgbVnQ9IoEtJE40KYMwifUPhU7zrzuwuzNJ6xuP3Vb1W6ZhG1yL+6348nwSF5+al5FNR/2uAotJfPnwlsiKyVTDgRGCQqlAx+jA8c52hAI2MYd74cqdX27O0abbbwXdZjnw/ffX4+OfXDFqWWd9oofJusZ9T4XWVcWMXHJAC13oGRRAD2yHJJVTkojFKLZyV4+83vSLf6R2yucj3490lae2FYKxZ09yFaSrDybQzmhs4Y5BC9MCSp5BTEiFVXYQLZK0NR3tqO7pmqr+e2b5RpsdXGThU12r+/lMB/lV9ej44zVqY2JQR9oTO8scTYnMxZcOHq9QlmGSN9RxkAwiYNXzPDErLfM7ox/wbionul+3cZ7XcdXNz8cZ6pPbEoVMuUPMqUll9Kei6mMySCLHELgq5lpCE54sFEzFpkMIj47k38KM/xmK7qg6BDOd5PJeDS8OU7UnFpUWWle+jx+oavm1vH/u+if/44f/wZVFE16xw4AAA==", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:10 GMT"], "Content-Type": ["application/json"], "Transfer-Encoding": ["chunked"], "Connection": ["keep-alive"], "Vary": ["Accept-Encoding", "Accept, Accept-Language, Cookie"], "allow": ["GET, POST, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"], "Content-Encoding": ["gzip"]}, "status": {"code": 200, "message": "OK"}, "url": "/api/v3/parts.json?name=Bike&category=MODEL&limit=2&scope_id=bd5dceaa-a35e-47b0-9fc5-875410f4a56f&fields=id%2Cname%2Cref%2Cdescription%2Ccreated_at%2Cupdated_at%2Cproperties%2Ccategory%2Cclassification%2Cparent_id%2Cmultiplicity%2Cvalue_options%2Cproperty_type%2Cvalue%2Coutput%2Corder%2Cpart_id%2Cscope_id%2Cmodel_id%2Cproxy_source_id_name%2Cunit"}, "recorded_at": "2024-05-08T11:59:10"}, {"request": {"body": {"encoding": "utf-8", "string": "{\"name\": \"__test model for representations\", \"parent_id\": \"e4a047a6-4a00-41a6-bae4-732ac2f639de\", \"multiplicity\": \"ONE\"}"}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "], "Content-Length": ["120"], "Content-Type": ["application/json"]}, "method": "POST", "uri": "/api/v3/parts/create_child_model?fields=id%2Cname%2Cref%2Cdescription%2Ccreated_at%2Cupdated_at%2Cproperties%2Ccategory%2Cclassification%2Cparent_id%2Cmultiplicity%2Cvalue_options%2Cproperty_type%2Cvalue%2Coutput%2Corder%2Cpart_id%2Cscope_id%2Cmodel_id%2Cproxy_source_id_name%2Cunit"}, "response": {"body": {"encoding": "utf-8", "string": "{\"results\":[{\"id\":\"d5102b87-29e6-4137-a27c-1d0f3ad046fa\",\"name\":\"__test model for representations\",\"ref\":\"test-model-for-representations\",\"description\":\"\",\"category\":\"MODEL\",\"classification\":\"PRODUCT\",\"multiplicity\":\"ONE\",\"created_at\":\"2024-05-08T11:59:10.405575Z\",\"updated_at\":\"2024-05-08T11:59:10.405580Z\",\"scope_id\":\"bd5dceaa-a35e-47b0-9fc5-875410f4a56f\",\"parent_id\":\"e4a047a6-4a00-41a6-bae4-732ac2f639de\",\"model_id\":null,\"proxy_source_id_name\":null,\"properties\":[],\"output\":true}]}"}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:10 GMT"], "Content-Type": ["application/json"], "Content-Length": ["485"], "Connection": ["keep-alive"], "vary": ["Accept, Accept-Language, Cookie"], "allow": ["POST, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"]}, "status": {"code": 201, "message": "Created"}, "url": "/api/v3/parts/create_child_model?fields=id%2Cname%2Cref%2Cdescription%2Ccreated_at%2Cupdated_at%2Cproperties%2Ccategory%2Cclassification%2Cparent_id%2Cmultiplicity%2Cvalue_options%2Cproperty_type%2Cvalue%2Coutput%2Corder%2Cpart_id%2Cscope_id%2Cmodel_id%2Cproxy_source_id_name%2Cunit"}, "recorded_at": "2024-05-08T11:59:10"}, {"request": {"body": {"encoding": "utf-8", "string": "{\"name\": \"__test object for representations\", \"part_id\": \"d5102b87-29e6-4137-a27c-1d0f3ad046fa\", \"description\": \"\", \"property_type\": \"USER_REFERENCES_VALUE\", \"value\": null, \"unit\": \"\", \"value_options\": {}}"}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "], "Content-Length": ["205"], "Content-Type": ["application/json"]}, "method": "POST", "uri": "/api/v3/properties/create_model?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "response": {"body": {"encoding": "utf-8", "string": "{\"results\":[{\"id\":\"bf6a57da-3f83-4ea7-b695-a8ae91ab8873\",\"name\":\"__test object for representations\",\"ref\":\"test-object-for-representations\",\"description\":\"\",\"property_type\":\"USER_REFERENCES_VALUE\",\"category\":\"MODEL\",\"order\":0,\"unit\":\"\",\"value_options\":{},\"value\":[],\"created_at\":\"2024-05-08T11:59:10.737531Z\",\"updated_at\":\"2024-05-08T11:59:10.752624Z\",\"part_id\":\"d5102b87-29e6-4137-a27c-1d0f3ad046fa\",\"scope_id\":\"bd5dceaa-a35e-47b0-9fc5-875410f4a56f\",\"model_id\":null,\"output\":true}]}"}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:10 GMT"], "Content-Type": ["application/json"], "Content-Length": ["483"], "Connection": ["keep-alive"], "vary": ["Accept, Accept-Language, Cookie"], "allow": ["POST, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"]}, "status": {"code": 201, "message": "Created"}, "url": "/api/v3/properties/create_model?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "recorded_at": "2024-05-08T11:59:10"}, {"request": {"body": {"encoding": "utf-8", "string": "{\"value_options\": {\"representations\": [{\"rtype\": \"showOnlyScopeMembers\", \"config\": {}}]}, \"id\": \"bf6a57da-3f83-4ea7-b695-a8ae91ab8873\"}"}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "], "Content-Length": ["135"], "Content-Type": ["application/json"]}, "method": "PUT", "uri": "/api/v3/properties/bf6a57da-3f83-4ea7-b695-a8ae91ab8873.json?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA32RTU/jMBCG/0rlM0Z2YsdJbqsle4JFaoEDCEWTeFyySmPLcRZVVf87E8qJlfbo8fN+eHxiEedlTDOrX05ssKxmnStAGws8d2XOFYLhXVFpDiVgJaErS5OzKzbBAYlu24Rz2vjuD/Zp43zcRAzkiVOCNPhpJjSiI3Ll+IXjxPF/OYtzH4ewHomnQYg+YEzHNh3DGva4a7bttvnVbJvfP5td+/Tj9rEhroeEex+PhNzd3zS3NPLRYmS1uGLLNKSL3V8YF2x9uOTVJ/a9wrqD+JU1v/n3+2k87nrqcIeHDuPasfeTG/YkPp9fz1+WpHulm4hUw7awpmUiU1xoLsoHKWtd1VJcm9zoXD6TyRLs/1B5LUqtlFrRADG1n/9itRRZVxqeVVhwJXPDITM9l1a4HKxQhQMSzGvfi6Kz2vYIwCHXyJXpBK9cr3lptJLCKdCFI8XBWxw/FdMyjrS6JYWFmqW4ID3yA/g2hkcjAgAA", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:11 GMT"], "Content-Type": ["application/json"], "Transfer-Encoding": ["chunked"], "Connection": ["keep-alive"], "Vary": ["Accept-Encoding", "Accept, Accept-Language, Cookie"], "allow": ["GET, PUT, PATCH, DELETE, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"], "Content-Encoding": ["gzip"]}, "status": {"code": 200, "message": "OK"}, "url": "/api/v3/properties/bf6a57da-3f83-4ea7-b695-a8ae91ab8873.json?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "recorded_at": "2024-05-08T11:59:11"}, {"request": {"body": {"encoding": "utf-8", "string": "{\"value_options\": {\"representations\": [{\"rtype\": \"showOnlyScopeMembers\", \"config\": {\"null\": null}}]}, \"id\": \"bf6a57da-3f83-4ea7-b695-a8ae91ab8873\"}"}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "], "Content-Length": ["147"], "Content-Type": ["application/json"]}, "method": "PUT", "uri": "/api/v3/properties/bf6a57da-3f83-4ea7-b695-a8ae91ab8873.json?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA32RTWvcMBCG/8qicxQky7Js30rjnvIBu00PDcGMrVHi4rWMLKcsy/73juKcGshFIPG8HzM6s4DLOsaF1U9nNlhWs84VoI0FrlypeI5geFdUmkMJWEnoytIodsUmOCLRbRtxiTvf/cE+7pwPu4AzeeIUIQ5+WggN6IhMHN84Thz/zFlc+jDM6Uo8PczBzxjiqY2nOYU9Hpp9u29+NPvm/ntzaH99u31siOsh4osPJ0LuHm6aW3rywWJgtbhi6zTEze4NxhVbP2959Zn9XyHtIHxkLa/+78M0ng49dbjDY4chdez95IaXJJ7WcWR1Oi+X58uHO1k8ExSQGtkWUnAmspwLzUX5U8paV7UU10YZreRv8ltn+xUqr3NVVBs6Q4jt+xdZLUXWlYZnFRY8l8pwyEzPpRVOgRV54YAES6q+KTqrbY8AHJRGnptO8Mr1mpdG51K4HHThSHH0Fsd3RZqLtrjGeaVmMaxIQ/4DcB+iuC4CAAA=", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:11 GMT"], "Content-Type": ["application/json"], "Transfer-Encoding": ["chunked"], "Connection": ["keep-alive"], "Vary": ["Accept-Encoding", "Accept, Accept-Language, Cookie"], "allow": ["GET, PUT, PATCH, DELETE, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"], "Content-Encoding": ["gzip"]}, "status": {"code": 200, "message": "OK"}, "url": "/api/v3/properties/bf6a57da-3f83-4ea7-b695-a8ae91ab8873.json?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "recorded_at": "2024-05-08T11:59:11"}, {"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "]}, "method": "GET", "uri": "/api/v3/properties/bf6a57da-3f83-4ea7-b695-a8ae91ab8873.json?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA32RTWvcMBCG/8qicxQky7Js30rjnvIBu00PDcGMrVHi4rWMLKcsy/73juKcGshFIPG8HzM6s4DLOsaF1U9nNlhWs84VoI0FrlypeI5geFdUmkMJWEnoytIodsUmOCLRbRtxiTvf/cE+7pwPu4AzeeIUIQ5+WggN6IhMHN84Thz/zFlc+jDM6Uo8PczBzxjiqY2nOYU9Hpp9u29+NPvm/ntzaH99u31siOsh4osPJ0LuHm6aW3rywWJgtbhi6zTEze4NxhVbP2959Zn9XyHtIHxkLa/+78M0ng49dbjDY4chdez95IaXJJ7WcWR1Oi+X58uHO1k8ExSQGtkWUnAmspwLzUX5U8paV7UU10YZreRv8ltn+xUqr3NVVBs6Q4jt+xdZLUXWlYZnFRY8l8pwyEzPpRVOgRV54YAES6q+KTqrbY8AHJRGnptO8Mr1mpdG51K4HHThSHH0Fsd3RZqLtrjGeaVmMaxIQ/4DcB+iuC4CAAA=", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:11 GMT"], "Content-Type": ["application/json"], "Transfer-Encoding": ["chunked"], "Connection": ["keep-alive"], "Vary": ["Accept-Encoding", "Accept, Accept-Language, Cookie"], "allow": ["GET, PUT, PATCH, DELETE, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"], "Content-Encoding": ["gzip"]}, "status": {"code": 200, "message": "OK"}, "url": "/api/v3/properties/bf6a57da-3f83-4ea7-b695-a8ae91ab8873.json?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "recorded_at": "2024-05-08T11:59:11"}, {"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "], "Content-Length": ["0"]}, "method": "DELETE", "uri": "/api/v3/parts/d5102b87-29e6-4137-a27c-1d0f3ad046fa.json"}, "response": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:12 GMT"], "Content-Type": ["application/json"], "Content-Length": ["14"], "Connection": ["keep-alive"], "vary": ["Accept, Accept-Language, Cookie"], "allow": ["GET, PUT, PATCH, DELETE, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"]}, "status": {"code": 204, "message": "No Content"}, "url": "/api/v3/parts/d5102b87-29e6-4137-a27c-1d0f3ad046fa.json"}, "recorded_at": "2024-05-08T11:59:12"}, {"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "], "Content-Length": ["0"]}, "method": "DELETE", "uri": "/api/v3/properties/bf6a57da-3f83-4ea7-b695-a8ae91ab8873.json"}, "response": {"body": {"encoding": "utf-8", "string": "{\"results\":[{\"detail\":\"Not found.\"}]}"}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:12 GMT"], "Content-Type": ["application/json"], "Content-Length": ["37"], "Connection": ["keep-alive"], "vary": ["Accept, Accept-Language, Cookie"], "allow": ["GET, PUT, PATCH, DELETE, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"]}, "status": {"code": 404, "message": "Not Found"}, "url": "/api/v3/properties/bf6a57da-3f83-4ea7-b695-a8ae91ab8873.json"}, "recorded_at": "2024-05-08T11:59:12"}], "recorded_with": "betamax/0.9.0"} \ No newline at end of file diff --git a/tests/cassettes/TestReprScopeMembersOnlyRepresentation.test_unsupported_value.json b/tests/cassettes/TestReprScopeMembersOnlyRepresentation.test_unsupported_value.json new file mode 100644 index 000000000..34486d63b --- /dev/null +++ b/tests/cassettes/TestReprScopeMembersOnlyRepresentation.test_unsupported_value.json @@ -0,0 +1 @@ +{"http_interactions": [{"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "]}, "method": "GET", "uri": "/api/v3/scopes.json?status=ACTIVE&name=Bike+Project&fields=id%2Cname%2Cref%2Ctext%2Ccreated_at%2Cupdated_at%2Cstart_date%2Cdue_date%2Cstatus%2Ccategory%2Cprogress%2Cmembers%2Cteam%2Ctags%2Cscope_options%2Cteam_id_name%2Cworkflow_root_id%2Ccatalog_root_id%2Capp_root_id%2Cproduct_model_id%2Cproduct_instance_id%2Ccatalog_model_id%2Ccatalog_instance_id%2Cproject_info&limit=2"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA7VVwW7kNgz9FcPXRoEky7I9p20Xe9hD26DJ7qFFMKBleqLGtgxZnt1BMP9eypNMPEi37WF7MGBS5OMjKT8/pcbNQ0g34iod8Cu9DHPXXaWjx7118/Rie5zmLpD5x1Nqm3ST1k3eGARgkOXIVFFzVrUmZ2WRK8FbBbluU8KEHin6J/uIyY13f6IJaURrIwQ52Xh2hqV8+hyVzBM2SXBJwCkkN4dHNA9ghwSGJhnn6SGxYTl9wKSzvSVqV+kUIETK6Y/v7z5+/kAeAwF3zh/I9+n2w2/b2/e/3ix+j3TSbCFWlFxUTHAm5R0vN1xvVHldFirP8t8pdB6bdajMGM+YyO+E2uTlRqlrzrmueAwNsIsTWhoj8yubjBuRBfA7DOk9EYz21o3BuoEin1K3R+9tg7f01ODTTQvdhHFAtIAJB2roFEpj9+EwxlmaeQqu/2jcEBtxQ2t3Eaqx09jBYfHH2ZqD6SKLlf9n10QAj7u5o2LHI1E6of0Ce7tbalGp+2NcBvRb22xP+zvdgR77Gv3rHZClpvFM6J+XPM0j+r2dnH9dPL3ZaQsm2D2Zwc/UHPZgu/PZCfXcefTAALtL1wr6GYScHUJzkX28OhHLLmjFC/QC+X14nRmsab3GfZOXesMrmq+kPpGV3JH7n9jBu/p66C45ngn9y+j+A8fq7fBi7P+60b+nFaFfWIm3F+1ydLcr1zfpPbh4E6aA/ofR9hmLzb0jDVqU5dq4/vvzv49Sugja1g6ti1/XolM+bKOsvHxazYwXNuXsSADO8vvF+ce2c1+23jlCigLMBW+05oqp3NRMlUaxUuUF01mb81JqUGV7UkDo3G6V2LSoSKk5U5WWTLUVsEqVghVYywZKUSgJlAjjuErKashKhYrJohCUxDkDqsJqWbZC51nDpU4X3s1MvfakNN0psypLVQmpmKhUxZQm9awQJBOqqlQNpKgcVpl2oOkMBk/JoHmRoapZXgmgTkVGFYv4qwEtoJaQmWzV5KpsrbVQJhdM5jllSqxYmcmSKSF1gSJroChWmZdlK07AWAmGpdCUwoHVhggIrelnoXJoZZYe749/ASxW3Ws+BwAA", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:12 GMT"], "Content-Type": ["application/json"], "Transfer-Encoding": ["chunked"], "Connection": ["keep-alive"], "Vary": ["Accept-Encoding", "Accept, Accept-Language, Cookie"], "allow": ["GET, POST, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"], "Content-Encoding": ["gzip"]}, "status": {"code": 200, "message": "OK"}, "url": "/api/v3/scopes.json?status=ACTIVE&name=Bike+Project&fields=id%2Cname%2Cref%2Ctext%2Ccreated_at%2Cupdated_at%2Cstart_date%2Cdue_date%2Cstatus%2Ccategory%2Cprogress%2Cmembers%2Cteam%2Ctags%2Cscope_options%2Cteam_id_name%2Cworkflow_root_id%2Ccatalog_root_id%2Capp_root_id%2Cproduct_model_id%2Cproduct_instance_id%2Ccatalog_model_id%2Ccatalog_instance_id%2Cproject_info&limit=2"}, "recorded_at": "2024-05-08T11:59:12"}, {"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "]}, "method": "GET", "uri": "/api/v3/parts.json?name=Bike&category=MODEL&limit=2&scope_id=bd5dceaa-a35e-47b0-9fc5-875410f4a56f&fields=id%2Cname%2Cref%2Cdescription%2Ccreated_at%2Cupdated_at%2Cproperties%2Ccategory%2Cclassification%2Cparent_id%2Cmultiplicity%2Cvalue_options%2Cproperty_type%2Cvalue%2Coutput%2Corder%2Cpart_id%2Cscope_id%2Cmodel_id%2Cproxy_source_id_name%2Cunit"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA9XWWW/jNhAA4L+y0HNmwfvwS+HduG1QJ1602p4oDJIaZYV6LUGWdhME+e8dH7HTNoAd2A/1kz1DUuLwoyg9ZKnu51024BfZHO/oz7yfzS6ypsUvVd0vnuIWF/2so/CPh6wqskGGKjBlgwH6ZaA4/YsBFVgpQhKlkb7AjK4ZPiP1flf9tYxaLCmI66DARWqrpqvqOSUpkUKHt3V7T9H15HI0XqZmYbGoyoqa1t0+/Di5/Pg+p6bPNJ+qmVWp6pYjJjej6fXw5rfloBbpSsU0UDWZYNwDZyBEztyAmYHyb7lxxqrfqWvfFPu7ulXXRaobnK5qj4UuEoYAQWoEZSMDXyYNzmrFWamCNiWNaEKL8249xDunPBcKuFcelGESPAYBXHmvYhBMsLAsqi5wthrxxFDf3U8Xdd+m5b2n6+XctjXYdhU+U6EZMIyshGRiAlUGBiGKEqxjzBvGpdblTuU7DO1iy3K7if7jsrnR/bS7b5bDrm7y6c/D8cfRq83qtsA2GzBa+Hm13WtfwqzHab26I9Xy8LhJPbXv9RSccaVf8BQMGK2xyLkYSDeQ7K3XXq89SWdjc+BWfv0GeI1m3XdNT7Pu2h4fLzacPGmmnUsgbVnQ9IoEtJE40KYMwifUPhU7zrzuwuzNJ6xuP3Vb1W6ZhG1yL+6348nwSF5+al5FNR/2uAotJfPnwlsiKyVTDgRGCQqlAx+jA8c52hAI2MYd74cqdX27O0abbbwXdZjnw/ffX4+OfXDFqWWd9oofJusZ9T4XWVcWMXHJAC13oGRRAD2yHJJVTkojFKLZyV4+83vSLf6R2yucj3490lae2FYKxZ09yFaSrDybQzmhs4Y5BC9MCSp5BTEiFVXYQLZK0NR3tqO7pmqr+e2b5RpsdXGThU12r+/lMB/lV9ej44zVqY2JQR9oTO8scTYnMxZcOHq9QlmGSN9RxkAwiYNXzPDErLfM7ox/wbionul+3cZ7XcdXNz8cZ6pPbEoVMuUPMqUll9Kei6mMySCLHELgq5lpCE54sFEzFpkMIj47k38KM/xmK7qg6BDOd5PJeDS8OU7UnFpUWWle+jx+oavm1vH/u+if/44f/wZVFE16xw4AAA==", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:12 GMT"], "Content-Type": ["application/json"], "Transfer-Encoding": ["chunked"], "Connection": ["keep-alive"], "Vary": ["Accept-Encoding", "Accept, Accept-Language, Cookie"], "allow": ["GET, POST, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"], "Content-Encoding": ["gzip"]}, "status": {"code": 200, "message": "OK"}, "url": "/api/v3/parts.json?name=Bike&category=MODEL&limit=2&scope_id=bd5dceaa-a35e-47b0-9fc5-875410f4a56f&fields=id%2Cname%2Cref%2Cdescription%2Ccreated_at%2Cupdated_at%2Cproperties%2Ccategory%2Cclassification%2Cparent_id%2Cmultiplicity%2Cvalue_options%2Cproperty_type%2Cvalue%2Coutput%2Corder%2Cpart_id%2Cscope_id%2Cmodel_id%2Cproxy_source_id_name%2Cunit"}, "recorded_at": "2024-05-08T11:59:12"}, {"request": {"body": {"encoding": "utf-8", "string": "{\"name\": \"__test model for representations\", \"parent_id\": \"e4a047a6-4a00-41a6-bae4-732ac2f639de\", \"multiplicity\": \"ONE\"}"}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "], "Content-Length": ["120"], "Content-Type": ["application/json"]}, "method": "POST", "uri": "/api/v3/parts/create_child_model?fields=id%2Cname%2Cref%2Cdescription%2Ccreated_at%2Cupdated_at%2Cproperties%2Ccategory%2Cclassification%2Cparent_id%2Cmultiplicity%2Cvalue_options%2Cproperty_type%2Cvalue%2Coutput%2Corder%2Cpart_id%2Cscope_id%2Cmodel_id%2Cproxy_source_id_name%2Cunit"}, "response": {"body": {"encoding": "utf-8", "string": "{\"results\":[{\"id\":\"793ed255-61c1-44a4-a00f-45d8f1af4735\",\"name\":\"__test model for representations\",\"ref\":\"test-model-for-representations\",\"description\":\"\",\"category\":\"MODEL\",\"classification\":\"PRODUCT\",\"multiplicity\":\"ONE\",\"created_at\":\"2024-05-08T11:59:13.001157Z\",\"updated_at\":\"2024-05-08T11:59:13.001163Z\",\"scope_id\":\"bd5dceaa-a35e-47b0-9fc5-875410f4a56f\",\"parent_id\":\"e4a047a6-4a00-41a6-bae4-732ac2f639de\",\"model_id\":null,\"proxy_source_id_name\":null,\"properties\":[],\"output\":true}]}"}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:13 GMT"], "Content-Type": ["application/json"], "Content-Length": ["485"], "Connection": ["keep-alive"], "vary": ["Accept, Accept-Language, Cookie"], "allow": ["POST, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"]}, "status": {"code": 201, "message": "Created"}, "url": "/api/v3/parts/create_child_model?fields=id%2Cname%2Cref%2Cdescription%2Ccreated_at%2Cupdated_at%2Cproperties%2Ccategory%2Cclassification%2Cparent_id%2Cmultiplicity%2Cvalue_options%2Cproperty_type%2Cvalue%2Coutput%2Corder%2Cpart_id%2Cscope_id%2Cmodel_id%2Cproxy_source_id_name%2Cunit"}, "recorded_at": "2024-05-08T11:59:13"}, {"request": {"body": {"encoding": "utf-8", "string": "{\"name\": \"__test object for representations\", \"part_id\": \"793ed255-61c1-44a4-a00f-45d8f1af4735\", \"description\": \"\", \"property_type\": \"USER_REFERENCES_VALUE\", \"value\": null, \"unit\": \"\", \"value_options\": {}}"}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "], "Content-Length": ["205"], "Content-Type": ["application/json"]}, "method": "POST", "uri": "/api/v3/properties/create_model?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "response": {"body": {"encoding": "utf-8", "string": "{\"results\":[{\"id\":\"e094d700-7d50-4930-9633-97e3fcd53ce5\",\"name\":\"__test object for representations\",\"ref\":\"test-object-for-representations\",\"description\":\"\",\"property_type\":\"USER_REFERENCES_VALUE\",\"category\":\"MODEL\",\"order\":0,\"unit\":\"\",\"value_options\":{},\"value\":[],\"created_at\":\"2024-05-08T11:59:13.306518Z\",\"updated_at\":\"2024-05-08T11:59:13.316481Z\",\"part_id\":\"793ed255-61c1-44a4-a00f-45d8f1af4735\",\"scope_id\":\"bd5dceaa-a35e-47b0-9fc5-875410f4a56f\",\"model_id\":null,\"output\":true}]}"}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:13 GMT"], "Content-Type": ["application/json"], "Content-Length": ["483"], "Connection": ["keep-alive"], "vary": ["Accept, Accept-Language, Cookie"], "allow": ["POST, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"]}, "status": {"code": 201, "message": "Created"}, "url": "/api/v3/properties/create_model?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "recorded_at": "2024-05-08T11:59:13"}, {"request": {"body": {"encoding": "utf-8", "string": "{\"value_options\": {\"representations\": [{\"rtype\": \"showOnlyScopeMembers\", \"config\": {}}]}, \"id\": \"e094d700-7d50-4930-9633-97e3fcd53ce5\"}"}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "], "Content-Length": ["135"], "Content-Type": ["application/json"]}, "method": "PUT", "uri": "/api/v3/properties/e094d700-7d50-4930-9633-97e3fcd53ce5.json?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA32Rz0/DIBTH/5WFsxg6oKy9Ga2nTZNNPWhMw+Axa7pCKNUsy/53H86TJh55fL4/4B1JhHHq00jqlyPpLKkJsEpYxRhVVjIqKs5oVXJOKwXcGSu5AUkuyKD3gHTbJhjTzG/fwaSZ83EWIaAnDEmnzg8johEckpmjZ44iR/9yFkYTu5CPyOMgRB8gpkObDiGHPW6adbtubpt1c3fdbNqnq+Vjg5zRCXY+HhBZ3d80Sxz5aCGSml2QaejS2e5D9xO0Ppzz6iP5XSH/QfzJGt/85/3QHzYGO6xgv4WYOxo/uG6H4tPp9fRjibpXvImANWyrc9qczQVlkrLFQ1HUsqoLfslZKYvFM5pMwf6PllWlFMto0DG133tRFQc7l5KWhSmoEFpQzZijQtqFK7QTiue9jLnvWbG10hrQmmougQq1xU06I+lCSVEwJ7QsHSr23kL/rRimvsevm1KYsFmKE+AjvwBaVH1rIwIAAA==", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:13 GMT"], "Content-Type": ["application/json"], "Transfer-Encoding": ["chunked"], "Connection": ["keep-alive"], "Vary": ["Accept-Encoding", "Accept, Accept-Language, Cookie"], "allow": ["GET, PUT, PATCH, DELETE, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"], "Content-Encoding": ["gzip"]}, "status": {"code": 200, "message": "OK"}, "url": "/api/v3/properties/e094d700-7d50-4930-9633-97e3fcd53ce5.json?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "recorded_at": "2024-05-08T11:59:13"}, {"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "], "Content-Length": ["0"]}, "method": "DELETE", "uri": "/api/v3/parts/793ed255-61c1-44a4-a00f-45d8f1af4735.json"}, "response": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:14 GMT"], "Content-Type": ["application/json"], "Content-Length": ["14"], "Connection": ["keep-alive"], "vary": ["Accept, Accept-Language, Cookie"], "allow": ["GET, PUT, PATCH, DELETE, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"]}, "status": {"code": 204, "message": "No Content"}, "url": "/api/v3/parts/793ed255-61c1-44a4-a00f-45d8f1af4735.json"}, "recorded_at": "2024-05-08T11:59:14"}, {"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["python-requests/2.31.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.10.0"], "Authorization": ["Token "], "Content-Length": ["0"]}, "method": "DELETE", "uri": "/api/v3/properties/e094d700-7d50-4930-9633-97e3fcd53ce5.json"}, "response": {"body": {"encoding": "utf-8", "string": "{\"results\":[{\"detail\":\"Not found.\"}]}"}, "headers": {"Server": ["nginx"], "Date": ["Wed, 08 May 2024 11:59:14 GMT"], "Content-Type": ["application/json"], "Content-Length": ["37"], "Connection": ["keep-alive"], "vary": ["Accept, Accept-Language, Cookie"], "allow": ["GET, PUT, PATCH, DELETE, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"]}, "status": {"code": 404, "message": "Not Found"}, "url": "/api/v3/properties/e094d700-7d50-4930-9633-97e3fcd53ce5.json"}, "recorded_at": "2024-05-08T11:59:14"}], "recorded_with": "betamax/0.9.0"} \ No newline at end of file diff --git a/tests/models/test_representations.py b/tests/models/test_representations.py index 509ba9a9d..b6921af46 100644 --- a/tests/models/test_representations.py +++ b/tests/models/test_representations.py @@ -25,6 +25,7 @@ DecimalPlaces, GeoCoordinateRepresentation, LinkTarget, + ScopeMembersOnlyRepresentation, SignatureRepresentation, SignificantDigits, ThousandsSeparator, @@ -197,7 +198,6 @@ def test_set_value(self): self.assertEqual(first_repr.value, first_representation.value) def test_unsupported_value(self): - with self.assertRaises(IllegalArgumentError): self.representation_class( obj=self.obj, @@ -473,3 +473,10 @@ def _get_object(self): class TestReprScope(Bases._TestCustomIconRepresentation): def _get_object(self): return self.client.create_scope(name=self.test_object_name) + + +class TestReprScopeMembersOnlyRepresentation(Bases._TestPropertyRepresentation): + property_type = PropertyType.USER_REFERENCES_VALUE + representation_class = ScopeMembersOnlyRepresentation + value = None + new_value = None