kmmbvnr/django-any — pull request #16 by leporo (2012-06-19 17:23:29+00:00)
Title: Generate timezone-aware dates and datetimes if the timezone support is enabled.

One can get a huge amount of warnings looking like this:

/django/db/models/fields/__init__.py:808: RuntimeWarning: DateTimeField received a naive datetime (1999-01-25 20:06:41) while time zone support is active.

when the Django 1.4 timezone support is enabled.

This patch fixes the issue.

It also fixes another issue: sometimes a generated datetime value becomes invalid when timezone rules are applied to it. Each year we skip a hour when applying daytime saving time rules. Sometimes a generated 'naive' value hits one of these skipped hours when become a timezone-aware. This may result in random errors and test failures.