1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Add test for updated paths on cable status change

This commit is contained in:
Jeremy Stretch
2020-10-01 17:25:44 -04:00
parent 0d07b0346b
commit 3b0a75edf8
4 changed files with 109 additions and 29 deletions

View File

@@ -980,6 +980,9 @@ class Cable(ChangeLoggedModel, CustomFieldModel):
# A copy of the PK to be used by __str__ in case the object is deleted
self._pk = self.pk
# Cache the original status so we can check later if it's been changed
self._orig_status = self.status
@classmethod
def from_db(cls, db, field_names, values):
"""
@@ -992,8 +995,6 @@ class Cable(ChangeLoggedModel, CustomFieldModel):
instance._orig_termination_b_type_id = instance.termination_b_type_id
instance._orig_termination_b_id = instance.termination_b_id
instance._orig_status = instance.status
return instance
def __str__(self):