[Django]-Django test set created_at field

6👍

Simplest way would be to use .update() as it would do UPDATE SQL statement that will not call any of Django methods

session = Session.objects.create(session_token='', ...).
session.filter(pk=session.pk).update(updated_at=older_date_time,..)

Other ideas are fixtures or mocking

Leave a comment