| 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 model.versioned_config import VersionedConfig |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 def testUpdateWhenChanged(self): | 32 def testUpdateWhenChanged(self): |
| 33 self._CreateFirstVersion() | 33 self._CreateFirstVersion() |
| 34 config = _Config.Get() | 34 config = _Config.Get() |
| 35 self.assertIsNotNone(config) | 35 self.assertIsNotNone(config) |
| 36 self.assertTrue(config.Update(users.User(email='admin@chromium.org'), True, | 36 self.assertTrue(config.Update(users.User(email='admin@chromium.org'), True, |
| 37 a=2)) | 37 a=2)) |
| 38 | 38 |
| 39 config = _Config.Get() | 39 config = _Config.Get() |
| 40 self.assertIsNotNone(config) | 40 self.assertIsNotNone(config) |
| 41 self.assertEqual(2, config.version) | 41 self.assertEqual(2, config.version_number) |
| 42 self.assertEqual(2, config.a) | 42 self.assertEqual(2, config.a) |
| 43 | 43 |
| 44 def testNotUpdateWhenNotChanged(self): | 44 def testNotUpdateWhenNotChanged(self): |
| 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) | 53 self.assertEqual(1, config.version_number) |
| 54 self.assertEqual(1, config.a) | 54 self.assertEqual(1, config.a) |
| OLD | NEW |