Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: appengine/findit/model/test/versioned_config_test.py

Issue 2376263002: [Findit] Renaming version property in versioned_model.py to avoid conflicts with base_analysis.py (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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)
OLDNEW
« no previous file with comments | « appengine/findit/handlers/config.py ('k') | appengine/findit/model/test/versioned_model_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698