fvalverd/django-chocolate — pull request #2 by fbanados (2012-10-17 15:57:04+00:00)
Title: Semi fix for current tests: This should not go to juanique's repo, but is useful now.

There is an issue that needs future rework. This code is needed by now
for tests to work, but it is just a patch solution. However, there is
indeed a django-chocolate issue here:
1. as django standard generator is called first, there is no
consideration of custom details of the mockup (might be from the
Mockup.generate_value call, but it might be from the entire
Mockup.generate_value implementation). So, restrictions enforced in the
custom mockup do not get into the post_data. (think on UserProfile first
and last_name fields in UserProfile)

2. There is a key issue with datetimes. When generating post data, they
should be strings. However, the system generated datetime objects. so d
dictionary comparison retrieved errors. In fact, it should take into
consideration the standard tastypie dehydrate process. This is not
implemented yet, but a hint is given by the new method names (so can be
rewritten afterwards) that are used at the generators. Instead of
generate_value(), sometimes you want to dehydrate first. Needs further
thought, but for now it works in our conditions.