Monday, September 30, 2013

Re: Testing: @override_settings(AUTH_USER_MODEL='auth.User') no working.

Thanks, it worked.
Changing @override_settings(AUTH_USER_MODEL='auth.User') for
@override_settings(AUTH_USER_MODEL='auth.CustomUser') made the trick.

On Sun, Sep 29, 2013 at 9:09 PM, Russell Keith-Magee
<russell@keith-magee.com> wrote:
>
> On Mon, Sep 30, 2013 at 7:27 AM, Serge G. Spaolonzi <serge@cobalys.com>
> wrote:
>>
>> Hi,
>>
>> I am failing to override the AUTH_USER_MODEL settings for a unittest, it
>> throws:
>>
>> "Manager isn't available; User has been swapped for 'None'"
>>
>> Is it possible to override AUTH_USER_MODEL in the unittest?
>> My goal is to use the default user model provided by django for the test
>> only.
>
>
> Yes, it is possible. That's why the approach is documented:
>
> https://docs.djangoproject.com/en/dev/topics/auth/customizing/#custom-users-and-testing-fixtures
>
> If you're getting an error, It sounds like something else is going wrong in
> your test suite -- my guess would be that you haven't got the auth app in
> INSTALLED_APPS. However, it's impossible to say for sure without seeing more
> code.
>
> Yours,
> Russ Magee %-)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscribe@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.



--
Serge G. Spaolonzi
Cobalys Systems
http://www.cobalys.com

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BrwjWXc-k166BhY5%3DRRM9LR21MFTyf9KqDMSozKErohbMEchw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment