Skip to content

v0.22.0 - Generated factories fill choices= fields with real values

Choose a tag to compare

@github-actions github-actions released this 11 Nov 05:43
· 27 commits to main since this release
1af4712

Generated factories fill choices= fields with real values.

Added

  • Generate factory_boy factory: choices= fields get a real factory.Iterator. Kind.choices becomes Kind.values (with a # TODO: import Kind comment), a named list such as STATUS_CHOICES becomes [value for value, _label in STATUS_CHOICES] (with a # TODO: import ... comment), and an inline list of pairs uses the first element of each pair. Calls and grouped choices still get the [...] # TODO placeholder (#228).

Fixed

  • drift: objects = models.Manager() is no longer a model field. Both parsers treated any models.<Name>(...) assignment as a field, so an explicit default manager showed up in scan, describe, ER diagrams, and, worst of all, blocking drift. Manager and QuerySet are skipped in both cli/orm_lens/parser.py and src/parser.ts, with the whole call skipped so multi-line declarations do not leak their arguments. TaggableManager stays a relation. The saleor golden snapshot drops the objects field that its Category model declares.