Wednesday, April 27, 2011

Re: Running Django tests from Python

On 04/27/2011 04:06 PM, Kenny Meyer wrote:
> Hi Shawn,
>
> http://docs.djangoproject.com/en/dev/ref/django-admin/#running-management-commands-from-your-code
>
> Does this answer your question?
>
> Kenny
>
Kenny,

This is *exactly* what I was looking for.

Unfortunately it doesn't work. It keeps saying that an app with that
label can not be found.

I've traced it down to django.db.models.loading.py, which imports
settings from django.conf, but it's
always 'django.conf.LazySettings object' instead of the proper settings
file.

This is odd, because os.environ['DJANGO_SETTINGS_MODULE'] is properly
set if I check it in pdb during that function.

I've even tried passing my settings module as a kwarg as described in
the doc you sent which doesn't work either.
In any case, I'm using the default -- 'settings.py' in the project folder.

Any ideas?

Thanks,
Shawn

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate