title: How to test DateTimeProperty in App Engine NDB?
body: <p>I'm trying to test a filter for the DateTimeProperty with App Engine's NDB but I have it set to auto_now?</p>
  
  <p>Is there a way to get around this for unit testing?</p>
  
  <p>Example:</p>
  
  <pre><code>class MyModel(ndb.Model)
    timestamp = ndb.DateTimeProperty(auto_now)
    name = ndb.StringProperty()
  
  
  def testMyModelFilter(self):
    test1 = MyModel()
    test1.timestamp = datetime.datetime.now() - datetime.timedelta(hours=2)
    test1.put()
    test2 = MyModel()
    test2.timestamp = datetime.datetime.now() - datetime.timedelta(hours=1)
    test2.put()
  
    hour_ago = datetime.datetime.now() - datetime.timedelta(hours=1)
    fetched = MyModel.query().filter(MyModel.timestamp &lt; hour_ago).fetch(
        None, keys_only=True)
  </code></pre>
  
  <p>Unfortunately, when I commit it to the datastore with test.put(), it uses the time when it was put().</p>