1
0
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:
Stefan Pratter
2020-04-10 09:03:12 +00:00
parent e630aea692
commit 3298b6626d
8 changed files with 137 additions and 21 deletions

View File

@ -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)