]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Correct db functional tests to support oslo.db 1.50
authorCedric Brandily <zzelle@gmail.com>
Thu, 26 Feb 2015 10:33:19 +0000 (10:33 +0000)
committerCedric Brandily <zzelle@gmail.com>
Thu, 26 Feb 2015 11:01:14 +0000 (11:01 +0000)
Currently test_migrations[1] uses _cleanup private method defined in
oslo_db.sqlalchemy.test_migrations which has been removed in oslo.db
1.5.0. This change corrects test_migrations[1] based on oslo.db
change I16bfa3af0e1ad6a9231ea38dea7cd76092347f55.

[1] neutron.tests.functional.db package

Change-Id: I35676ca2e5900d7fd95a11d6c7dd3ad1c9a686e2
Closes-Bug: #1425890

neutron/tests/functional/db/test_migrations.py

index 05d1fac1d68dda40cffe42df2b83f93159a6c787..63857fb98b5cddd26e45ebf54cb300c1f379b2c5 100644 (file)
@@ -12,6 +12,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+import functools
 import logging
 import pprint
 
@@ -156,7 +157,8 @@ class _TestModelsMigrations(test_migrations.ModelsMigrationsSync):
 
     def test_models_sync(self):
         # drop all tables after a test run
-        self.addCleanup(self._cleanup)
+        self.addCleanup(functools.partial(self.db.backend.drop_all_objects,
+                                          self.get_engine()))
 
         # run migration scripts
         self.db_sync(self.get_engine())