Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow DjangoModelFactories to use 'app.Model'. #66
As moved over from dnerdy#9
The convention of identifying model instances by
I understand that factory_boy aims to support multiple ORMs etc, which is why the patch on the other project is applied only to
My main reason for doing this is that my
If you are willing to reconsider your opposition to the proposed behaviour, then I can upgrade the patch apporpriately.
Thanks for the clarification. I had misread your initial proposal, and thought you intended to use the
Using two options for settings
I tend to create a
import factory from . import models class MyModelFactory(factory.django.DjangoModelFactory): FACTORY_FOR = models.MyModel
Could you give an example of a code layout where using
I tend to keep my tests in a separate
To me this is a very "Djangoy" approach. As far as I can tell, there are almost no cases in Django when you cannot use this way of referring to a model, and I would view it as an expected API.
The original patch overrides
We could in theory use full dotted paths to classes which would be more generic, but be a little more verbose for Django users.