1
0
mirror of https://github.com/peeringdb/peeringdb.git synced 2024-05-11 05:55:09 +00:00

April update fixes 2 (#700)

* add tech contact and sales contact fields to add / suggest facility forms (#378)

* add swagger docs as backup api docs under apidocs/swagger/ (#626)

* tech and sales phone number fields arent required and should KeyError when missing from POST data (#378, #699)

* re-enable Try it out functionality for swagger docs (#626)

Co-authored-by: Stefan Pratter <stefan@20c.com>
This commit is contained in:
Matt Griswold
2020-04-20 09:45:48 -05:00
committed by GitHub
parent 5272ec80f7
commit dbedb5e606
7 changed files with 107 additions and 1 deletions

View File

@ -1123,6 +1123,7 @@ class TestJSON(unittest.TestCase):
test_failure=SHARED["fac_r_ok"].id,
)
##########################################################################
def test_org_admin_002_POST_PUT_DELETE_net(self):
@ -2890,6 +2891,34 @@ class TestJSON(unittest.TestCase):
# MISC TESTS
##########################################################################
def test_z_misc_POST_ix_fac_missing_phone_fields(self):
"""
Test that omitting the *_phone fields during fac
and ix object creation doesnt error 500
TODO: a test that drops all the non-required fields
and tests for every reftag model
"""
data = self.make_data_fac()
db = self.db_org_admin
del data["tech_phone"]
r = db.create("fac", data, return_response=True).get("data")
data = self.make_data_fac()
del data["sales_phone"]
r = db.create("fac", data, return_response=True).get("data")
data = self.make_data_ix(prefix=self.get_prefix4())
del data["tech_phone"]
r = db.create("ix", data, return_response=True).get("data")
data = self.make_data_ix(prefix=self.get_prefix4())
del data["policy_phone"]
r = db.create("ix", data, return_response=True).get("data")
def test_z_misc_002_dupe_netixlan_ip(self):
# test that addint duplicate netixlan ips is impossible