

def test_post_no_entity_key_string(self):
    request = webapp2.Request.blank('/datastore/edit', POST={
        'kind': 'Kind1',
        'overflowdatetime|dateprop': '2009-12-24 23:59:59',
        'int|intprop': '123',
        'string|stringprop': 'Hello',
        'next': 'http://redirect/',
    })
    response = webapp2.Response()
    handler = datastore_viewer.DatastoreEditRequestHandler(request, response)
    self.mox.ReplayAll()
    handler.post()
    self.mox.VerifyAll()
    self.assertEqual(302, response.status_int)
    self.assertEqual('http://redirect/', response.location)
    query = datastore.Query('Kind1')
    query.update({
        'dateprop': datetime.datetime(2009, 12, 24, 23, 59, 59),
        'intprop': 123,
        'stringprop': 'Hello',
    })
    self.assertEquals(1, query.Count())

dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/tools/devappserver2/admin/datastore_viewer_test.py DatastoreEditRequestHandlerTest.test_post_no_entity_key_string/original