Friday, December 14, 2012

Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

On Fri, Dec 14, 2012 at 3:02 PM, Chris Cogdon <chris@cogdon.org> wrote:
> Nothing definitive, but from checking the location of the code that is
> raising the warning, I suspect one of the following:
>
> 1. USE_TZ is not set in your production code, but _is_ set in your settings
> file for your tests. Of course, your code should work either way for the
> most flexibility.

USE_TZ is set in settings.py (in production code)
>
> 2. The test database you are using (ie, from fixtures or otherwise) has
> non-timezone dates and times, and USE_TZ is set in your testing settings
> files. In these cases your test data and the USE_TZ setting should be
> matching.

No fixtures. Creating test objects in the test setup code.

--
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