On Fri, Dec 14, 2012 at 5:46 PM, bobhaugen <bob.hau...@gmail.com> wrote:
> RuntimeWarning: DateTimeField received a naive datetime (2012-12-14
> 17:39:38.878379) while time zone support is active.
>
> This is happening in my tests, but not in normal code.
>
> From dropping a trace in, it looks like it is happening before the test
> setup even runs.
>
> I double-checked my models,  not a DateTimeField in the lot. Nor anywhere
> else in my code except for South migrations, where it is found in
> models['auth.user']. (But I'm not creating any Users in my test code,
> either...)
>
> The tests run ok, but the error messages will be disconcerting to people who
> install my open-source project code.
>
> Any clues?
>
> Thanks.
>

Following the thread I see that you have figured out where and why
this is coming from. There is a simple tip you can use to speed this
up in future, simply run python with warnings set to error, and any
Warnings will be converted into RuntimeErrors - so you get a lovely
stack trace showing exactly how and when the warning was issued.

You can configure python to stop only on certain Warnings, but the
simplest way is to turn all Warnings into Errors:

python -W error manage.py ....

Full details on what you can specify with -W here:

http://docs.python.org/2/library/warnings.html#the-warnings-filter

Cheers

Tom

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to