summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/models/base_models.py
diff options
context:
space:
mode:
Diffstat (limited to 'testapi/opnfv_testapi/models/base_models.py')
-rw-r--r--testapi/opnfv_testapi/models/base_models.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/testapi/opnfv_testapi/models/base_models.py b/testapi/opnfv_testapi/models/base_models.py
index 27396d1..cd437d9 100644
--- a/testapi/opnfv_testapi/models/base_models.py
+++ b/testapi/opnfv_testapi/models/base_models.py
@@ -22,6 +22,11 @@ from opnfv_testapi.tornado_swagger import swagger
class ModelBase(object):
+ def __eq__(self, other):
+ res = all(getattr(self, k) == getattr(other, k)
+ for k in self.format().keys() if k != '_id')
+ return res
+
def format(self):
return self._format(['_id'])