| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from google.appengine.ext import ndb | 5 from google.appengine.ext import ndb |
| 6 from google.appengine.api import users | 6 from google.appengine.api import users |
| 7 from testing_utils import testing | 7 from testing_utils import testing |
| 8 | 8 |
| 9 from model.versioned_config import VersionedConfig | 9 from gae_libs.model.versioned_config import VersionedConfig |
| 10 | 10 |
| 11 | 11 |
| 12 class _Config(VersionedConfig): | 12 class _Config(VersionedConfig): |
| 13 a = ndb.IntegerProperty(indexed=False, default=0) | 13 a = ndb.IntegerProperty(indexed=False, default=0) |
| 14 | 14 |
| 15 | 15 |
| 16 class VersionedConfigTest(testing.AppengineTestCase): | 16 class VersionedConfigTest(testing.AppengineTestCase): |
| 17 | 17 |
| 18 def _CreateFirstVersion(self): | 18 def _CreateFirstVersion(self): |
| 19 config = _Config.Get() | 19 config = _Config.Get() |
| (...skipping 25 matching lines...) Expand all Loading... |
| 45 self._CreateFirstVersion() | 45 self._CreateFirstVersion() |
| 46 config = _Config.Get() | 46 config = _Config.Get() |
| 47 self.assertIsNotNone(config) | 47 self.assertIsNotNone(config) |
| 48 self.assertFalse(config.Update(users.User(email='admin@chromium.org'), True, | 48 self.assertFalse(config.Update(users.User(email='admin@chromium.org'), True, |
| 49 a=1)) | 49 a=1)) |
| 50 | 50 |
| 51 config = _Config.Get() | 51 config = _Config.Get() |
| 52 self.assertIsNotNone(config) | 52 self.assertIsNotNone(config) |
| 53 self.assertEqual(1, config.version_number) | 53 self.assertEqual(1, config.version_number) |
| 54 self.assertEqual(1, config.a) | 54 self.assertEqual(1, config.a) |
| OLD | NEW |