Merge remote-tracking branch 'origin/dev' into sub_laptop_5

This commit is contained in:
2026-11-18 21:42:40 +09:00
2 changed files with 6 additions and 5 deletions
+2 -4
View File
@@ -319,12 +319,10 @@ def logic_new(logic: dict, owner: str = OWNERS[0], source: str = "") -> dict:
def logic_copy(key: str, 이름: str = "", owner: str = OWNERS[0], more: dict | None = None) -> dict:
"""본떠 만들기 = [복사/생성] — 원본 문서를 새 자체 기초로 복제(정본도 본뜸) · 비고 끝에 본뜬 키 ·
"""본떠 만들기 = [복사/생성] — 원본 문서를 새 자체 기초로 복제(원본과 안 이어짐 · 비고 그대로) ·
`more` = 기본정보 창에서 고친 원문번호 · 결과단위 · 출처(빈 글은 원본 그대로)."""
_, doc = doc_store.find(key)
row = doc_store.head_of(doc)
note = " · ".join(x for x in (str(row.get("비고") or ""), f"{key} 를 본뜸") if x)
copy = {**row, "비고": note, **{k: v for k, v in (more or {}).items() if v}}
copy = {**doc_store.head_of(doc), **{k: v for k, v in (more or {}).items() if v}}
if 이름:
copy["이름"] = 이름
return logic_new(copy, owner, key)
+4 -1
View File
@@ -114,7 +114,10 @@ def test_자체_로직_만들기_본뜨기_고치기_지우기(client: TestClien
assert again["key"] != made["key"] # 원문번호가 같아도 키는 하나씩
copied = _post(client, "/api/m01/logic/copy", {"key": SAMPLE, "이름": "메쌓기 본뜸"})
assert copied["key"] != SAMPLE and f"{SAMPLE} 를 본뜸" in copied["logic"]["비고"]
origin = _get(client, "/api/m01/logic", key=SAMPLE)["logic"]
assert (
copied["key"] != SAMPLE and copied["logic"]["비고"] == origin["비고"]
) # 본뜬 키 글 없음(요구 903)
assert copied["logic"]["이름"] == "메쌓기 본뜸" and copied["logic"]["소유"] == "현장"
assert copied["logic"]["상세구분"] == "13장 구조물"