class Record(ndb.Model):
notes = ndb.TextProperty()
last_updated = ndb.DateTimeProperty(auto_now=True)
単体テストのセットアップの一部:
record2 = Record()
# trying to set the last_updated timestamp to a previous date
record2.last_updated = previous_date
record2.put()
#after saving it, the timestamp is back to today's date
したがって、単体テスト用に古いレコードをエミュレートすることはできません。モデルを変更せずにそのフィールドをオーバーライドするにはどうすればよいですか?