fixed random error with networks in unit tests

Change-Id: I8f6eb850d688b676389991d0400fddc6bef4e31b
This commit is contained in:
Nikolay Markov 2013-10-18 16:40:32 +04:00
parent fba4845821
commit 9e534eb244
2 changed files with 7 additions and 3 deletions

View File

@ -187,8 +187,12 @@ class Cluster(Base):
# During cluster deletion sqlalchemy engine will set null
# into cluster foreign key column of notification entity
notifications = relationship("Notification", backref="cluster")
network_groups = relationship("NetworkGroup", backref="cluster",
cascade="delete")
network_groups = relationship(
"NetworkGroup",
backref="cluster",
cascade="delete",
order_by="NetworkGroup.id"
)
replaced_deployment_info = Column(JSON, default={})
replaced_provisioning_info = Column(JSON, default={})
is_customized = Column(Boolean, default=False)

View File

@ -36,7 +36,7 @@ class TestHandlers(BaseIntegrationTest):
{"cluster_id": cluster_id}),
headers=self.default_headers,
).body)["networks"]
return sorted(nets, key=lambda n: n['vlan_start'])
return nets
def test_cluster_list_empty(self):
resp = self.app.get(