Describe the Bug
We use factory-boy, specifically the DjangoModelFactory as a standard way to create models over bare .create calls.
pyrefly doesn't infer the return is a Django model:
{
"line": 393,
"column": 37,
"stop_line": 393,
"stop_column": 53,
"path": "src/paperless_mail/tests/test_api.py",
"code": -2,
"name": "missing-attribute",
"description": "Object of class `DocumentTypeFactory` has no attribute `pk`",
"concise_description": "Object of class `DocumentTypeFactory` has no attribute `pk`",
"severity": "error"
},
It would be nice if this could be directly inferred by pyrefly.
Sandbox Link
No response
(Only applicable for extension issues) IDE Information
No response
Describe the Bug
We use factory-boy, specifically the DjangoModelFactory as a standard way to create models over bare
.createcalls.pyrefly doesn't infer the return is a Django model:
{ "line": 393, "column": 37, "stop_line": 393, "stop_column": 53, "path": "src/paperless_mail/tests/test_api.py", "code": -2, "name": "missing-attribute", "description": "Object of class `DocumentTypeFactory` has no attribute `pk`", "concise_description": "Object of class `DocumentTypeFactory` has no attribute `pk`", "severity": "error" },It would be nice if this could be directly inferred by pyrefly.
Sandbox Link
No response
(Only applicable for extension issues) IDE Information
No response