﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
18867	Restoring YAML fixtures with DateTimeField causes timezone warnings	aigarius@…	Aymeric Augustin	"Loading a YAML fixture with a timezone aware DateTimeField in Django 1.4 will cause the following warning even if the field is defined with timezone information in the YAML file
{{{
django/db/models/fields/__init__.py:808: RuntimeWarning: DateTimeField received a naive datetime (2012-08-27 13:01:56.784734) while time zone support is active.
}}}
Excerpt from testdata.yaml
{{{
[...] , insert_date: !!timestamp '2012-08-27 13:01:56.784734+00:00', [...]
}}}
The test data is loaded by adding ""fixtures = ['testdata']"" at the start of a test case class.

This bug is mentioned in Django test suite - django/trunk/tests/modeltests/timezones/tests.py:SerializationTests

Note: the trick of ""MyTests = override_settings(USE_TZ=False)(MyTests)"" (from #17940) often does not work as expected, because you can then get ""ValueError: SQLite backend does not support timezone-aware datetimes when USE_TZ is False"" during fixture loading
"	Cleanup/optimization	closed	Database layer (models, ORM)	1.4	Normal	invalid		michi.schwarz@… tehfink	Accepted	0	0	0	0	0	0
