Skip to content

Evaluate SelfAttribute values nested in lists passed to Faker - #1159

Open
gyanu2507 wants to merge 1 commit into
FactoryBoy:masterfrom
gyanu2507:faker-selfattribute-in-list
Open

Evaluate SelfAttribute values nested in lists passed to Faker#1159
gyanu2507 wants to merge 1 commit into
FactoryBoy:masterfrom
gyanu2507:faker-selfattribute-in-list

Conversation

@gyanu2507

Copy link
Copy Markdown

factory.Faker("x", money=factory.SelfAttribute("..subtotal")) already resolves. The same SelfAttribute inside a list was left as an object, because unroll only looked at top-level kwargs.

Flatten those list items into the same unroll pass so .. still points at the parent factory.

Fixes #1120

Declarations inside a raw list were left as objects because unroll
only inspected top-level kwargs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

factory.SelfAttribute not evaluated when passed as list?

1 participant