New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django Factory gets the wrong manager for model on 2.5.0 #192

Closed
rubendura opened this Issue Mar 27, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@rubendura

rubendura commented Mar 27, 2015

Using factory_boy 2.5.0 break my build. I have a model using a custom manager for object creation but factory_boy is somehow ignoring it and using Django's default manager. When creating an object using my factory I expected I could pass extra arguments that my custom manager accepts. The documentation statest that

create() uses Model.objects.create()

but that doesn't seem to be true in 2.5.0.

I tried setting my model meta using import model syntax

from models import Model
class Meta:
    model = Model

and 'app.Model' syntax

class Meta:
    model = 'app.Model'

None of them work. factory_boy 2.4.1 works fine, but I can't figure out what changed between those versions that broke it.

@rbarrois

This comment has been minimized.

Show comment
Hide comment
@rbarrois

rbarrois Mar 27, 2015

Member

Hi,

Could you provide an example of how you declare your custom manager? I think the change comes from commit 636ca46.

Member

rbarrois commented Mar 27, 2015

Hi,

Could you provide an example of how you declare your custom manager? I think the change comes from commit 636ca46.

@rbarrois rbarrois added the Bug label Mar 27, 2015

@rubendura

This comment has been minimized.

Show comment
Hide comment
@rubendura

rubendura Mar 27, 2015

You can see the issue happening on the following commit.

rubendura@417c169

That test passes under commit 25bd44c "Fix support for Django 1.7."

Don't know if I should do a pull request for this as it only adds a failing test and no solution to it.

rubendura commented Mar 27, 2015

You can see the issue happening on the following commit.

rubendura@417c169

That test passes under commit 25bd44c "Fix support for Django 1.7."

Don't know if I should do a pull request for this as it only adds a failing test and no solution to it.

@rbarrois rbarrois closed this in bdc1b81 Mar 27, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment