diff --git a/scopes/storage/tracking.py b/scopes/storage/tracking.py index 1134b86..108227e 100644 --- a/scopes/storage/tracking.py +++ b/scopes/storage/tracking.py @@ -54,6 +54,11 @@ class Track(object): else: self.data.update(data) + def storeTrack(self): + """Make changes of this track persistent by updating the corresponding row + in its container.""" + self.container.update(self) + @property def uid(self): if self.trackId is None: diff --git a/tests/tlib_server.py b/tests/tlib_server.py index 949d482..70110cd 100644 --- a/tests/tlib_server.py +++ b/tests/tlib_server.py @@ -22,5 +22,5 @@ def test_app(self, config): storage = config.storageFactory(config.dbschema) response = publishRequest(config, storage, '/top') result = json.loads(response.consumeBody()) - self.assertEqual(result['items'][0]['head']['name'], 'child1') + self.assertEqual(result['items'][0]['head']['name'], 'level2-item1') diff --git a/tests/tlib_storage.py b/tests/tlib_storage.py index f911f2e..1912bc6 100644 --- a/tests/tlib_storage.py +++ b/tests/tlib_storage.py @@ -70,6 +70,8 @@ def test_folder(self, config): ch1 = top['child1'] self.assertEqual(ch1.parent, top.rid) self.assertEqual(list(top.keys()), ['child1']) + ch1.set('name', 'level2-item1') + ch1.storeTrack() storage.commit()