neutron/neutron/tests/unit/objects
Ihar Hrachyshka 8915febaaf objects: avoid deepcopying models in test_db_obj
SQLAlchemy may asynchronously push models out of session cache in which
case we may receive DetachedInstanceError.

In the test case, instead of deepcopying models to compare, compare
each modified attribute independently.

This change also includes conversion from InstrumentedLists to regular
lists when converting model attributes to object fields. The fact that
we were returning InstrumentedLists was always an oversight but it
revealed itself after the modification of the test case that is the
core of this patch.

When converting object fields to db, convert Port's distributed_binding
None value to a empty list to reflect that the relationship of the Port
database model is a list. It was not an issue before the patch because
we were not comparing model attribute for equality but for in-equality
before, and so None was always != [].

Finally, this patch moves a bunch of TODOs to better reflect where they
belong to.

Closes-Bug: #1770452
Change-Id: I42cdf540129bd4470ec1a59345db9845a6198328
(cherry picked from commit 1a8a15f630)
2019-04-30 14:26:12 +00:00
..
db Allow objects to opt in new engine facade 2018-02-09 04:07:34 +00:00
extensions [OVO] Switch to use own registry 2017-11-22 17:44:22 +01:00
logapi Enable an update test in UT of logging 2017-07-07 12:01:49 +09:00
plugins OVO for FlatAllocation 2016-12-22 13:25:50 +00:00
port Refactoring _create_test methods for OVO UTs 2017-04-17 12:05:19 -07:00
qos Fix error message when duplicate QoS rule is created 2018-02-14 15:01:20 +00:00
__init__.py objects.base: avoid db access if object does not have changes 2015-07-03 02:02:17 +03:00
test_address_scope.py Use BaseDbObjectTestCase in AddressScope UT 2016-10-12 14:17:15 -05:00
test_agent.py Add DictOfMiscValuesField in OVO for dict usage 2017-01-05 07:57:06 +00:00
test_auto_allocate.py Refactoring _create_test methods for OVO UTs 2017-04-17 12:05:19 -07:00
test_base.py objects: avoid deepcopying models in test_db_obj 2019-04-30 14:26:12 +00:00
test_common_types.py Support protocol numbers in security group API 2017-11-10 17:06:02 -05:00
test_flavor.py Refactoring _create_test methods for OVO UTs 2017-04-17 12:05:19 -07:00
test_floatingip.py Refactoring _create_test methods for OVO UTs 2017-04-17 12:05:19 -07:00
test_ipam.py Refactoring _create_test methods for OVO UTs 2017-04-17 12:05:19 -07:00
test_l3_hamode.py tests: generate unique network ids for L3HARouterVRIdAllocation 2017-09-15 13:25:35 -06:00
test_l3agent.py Add specific values to specific fields in get_random_object_fields() 2017-07-25 15:16:25 +09:00
test_metering.py Metering to OVO 2017-04-26 11:44:58 -07:00
test_network.py Allow objects to opt in new engine facade 2018-02-09 04:07:34 +00:00
test_objects.py Allow objects to opt in new engine facade 2018-02-09 04:07:34 +00:00
test_ports.py Allow objects to opt in new engine facade 2018-02-09 04:07:34 +00:00
test_provisioning_blocks.py Refactoring _create_test methods for OVO UTs 2017-04-17 12:05:19 -07:00
test_quota.py Use flake8-import-order plugin 2017-07-05 03:15:27 +00:00
test_rbac_db.py Allow objects to opt in new engine facade 2018-02-09 04:07:34 +00:00
test_router.py Router to OVO 2017-11-24 04:11:33 +00:00
test_securitygroup.py Fix slow SG api calls when limiting fields 2019-04-05 20:33:57 -06:00
test_servicetype.py ProviderResourceAssociation to OVO 2016-11-18 13:09:29 -06:00
test_subnet.py Allow objects to opt in new engine facade 2018-02-09 04:07:34 +00:00
test_subnetpool.py Use unique subnetpools in SubnetPoolPrefixDbObjectTestCase 2017-01-12 05:56:04 +00:00
test_tag.py Refactoring _create_test methods for OVO UTs 2017-04-17 12:05:19 -07:00
test_trunk.py objects: support tenant_id filter for get_* if project_id is present 2017-06-30 11:08:29 -04:00
test_utils.py objects: introduce a util function to handle tenant_id filter 2016-08-03 08:42:38 +00:00