@mock.patch.dict(
      handlers.settings.__dict__, {'XSRF_PROTECTION_ENABLED': False})
  def testWalkthrough(self):
    models.ProvisioningVolume.created.auto_now = False

    vol_uuid1 = str(uuid.uuid4()).upper()
    secret1 = str(uuid.uuid4())

    models.User(
        key_name='stub7@example.com', user=users.get_current_user(),
        provisioning_perms=[],
        ).put()

    models.ProvisioningVolume(
        owner='stub', created_by=users.get_current_user(),
        hdd_serial='stub', passphrase=secret1, created=datetime.datetime.now(),
        platform_uuid='stub', serial='stub', volume_uuid=vol_uuid1,
    ).put()

    old = datetime.datetime.now() - datetime.timedelta(days=365)
    models.ProvisioningVolume(
        owner='stub1',
        created_by=users.get_current_user(), hdd_serial='stub',
        passphrase=secret1, created=old, platform_uuid='stub', serial='stub',
        volume_uuid=str(uuid.uuid4()).upper()
    ).put()

    resp = gae_main.app.get_response(
        '/created?json=1', {'REQUEST_METHOD': 'GET'})

    self.assertEqual(200, resp.status_int)

    data = util.FromSafeJson(resp.body)

    self.assertEqual(1, len(data))
    self.assertEqual(secret1, data[0]['passphrase'])

    models.ProvisioningVolume.created.auto_now = True
dataset/ETHPy150Open google/cauliflowervest/src/tests/cauliflowervest/server/handlers/created_test.py/CreatedModuleTest.testWalkthrough/original