mirror of
https://github.com/peeringdb/peeringdb.git
synced 2024-05-11 05:55:09 +00:00
Add attribute operational
to netixlan
#539
revert accidentally commited change to netixlan js finalize function
This commit is contained in:
@ -1527,6 +1527,8 @@ class TestJSON(unittest.TestCase):
|
||||
},
|
||||
)
|
||||
|
||||
assert r_data["operational"]
|
||||
|
||||
SHARED["netixlan_id"] = r_data.get("id")
|
||||
|
||||
self.assert_update(
|
||||
@ -2349,6 +2351,30 @@ class TestJSON(unittest.TestCase):
|
||||
|
||||
##########################################################################
|
||||
|
||||
def test_guest_005_list_filter_netixlan_operational(self):
|
||||
|
||||
# all netixlans are operational at this point,
|
||||
# filtering by operational=False should return empty list
|
||||
|
||||
data = self.db_guest.all("netixlan", operational=0)
|
||||
assert len(data) == 0
|
||||
|
||||
# set one netixlan to not operational
|
||||
|
||||
netixlan = NetworkIXLan.objects.first()
|
||||
netixlan.operational=False
|
||||
netixlan.save()
|
||||
|
||||
# assert that it is now returned in the operational=False
|
||||
# result
|
||||
|
||||
data = self.db_guest.all("netixlan", operational=0)
|
||||
assert len(data) == 1
|
||||
assert data[0]["id"] == netixlan.id
|
||||
|
||||
|
||||
##########################################################################
|
||||
|
||||
def test_guest_005_list_filter_netixlan_related_name(self):
|
||||
data = self.db_guest.all("netixlan", name=SHARED["ix_rw_ok"].name)
|
||||
self.assertEqual(len(data), 1)
|
||||
|
Reference in New Issue
Block a user