def setUpTestData(cls): local_as = AutonomousSystem.objects.create(asn=64501, name="Autonomous System 1", affiliated=True) InternetExchange.objects.bulk_create([ InternetExchange( name="Internet Exchange 1", slug="ix-1", local_autonomous_system=local_as, ), InternetExchange( name="Internet Exchange 2", slug="ix-2", local_autonomous_system=local_as, ), InternetExchange( name="Internet Exchange 3", slug="ix-3", local_autonomous_system=local_as, ), ]) cls.form_data = { "peeringdb_ixlan": None, "name": "Internet Exchange 4", "slug": "ix-4", "local_autonomous_system": local_as.pk, "communities": [], "export_routing_policies": [], "import_routing_policies": [], "comments": "", "tags": [], } cls.bulk_edit_data = {"comments": "New comments"}
def setUpTestData(cls): cls.router = Router.objects.create(name="Router 1", hostname="router1.example.net") InternetExchange.objects.bulk_create([ InternetExchange(name="Internet Exchange 1", slug="ix-1"), InternetExchange(name="Internet Exchange 2", slug="ix-2"), InternetExchange(name="Internet Exchange 3", slug="ix-3", router=cls.router), ])
def setUpTestData(cls): cls.local_as = AutonomousSystem.objects.create( asn=64501, name="Autonomous System 1", affiliated=True) InternetExchange.objects.bulk_create([ InternetExchange(name="Internet Exchange 1", slug="ix-1"), InternetExchange(name="Internet Exchange 2", slug="ix-2"), InternetExchange( local_autonomous_system=cls.local_as, name="Internet Exchange 3", slug="ix-3", ), ])
def setUpTestData(cls): cls.local_as = AutonomousSystem.objects.create( asn=64501, name="Autonomous System 1", affiliated=True) cls.router = Router.objects.create( name="Router 1", hostname="router1.example.net", local_autonomous_system=cls.local_as, ) InternetExchange.objects.bulk_create([ InternetExchange(name="Internet Exchange 1", slug="ix-1"), InternetExchange(name="Internet Exchange 2", slug="ix-2"), InternetExchange( local_autonomous_system=cls.local_as, name="Internet Exchange 3", slug="ix-3", router=cls.router, ), ])
def setUpTestData(cls): cls.local_autonomous_system = AutonomousSystem.objects.create( asn=201281, name="Guillaume Mazoyer", affiliated=True) InternetExchange.objects.bulk_create([ InternetExchange( name="Example 1", slug="example-1", local_autonomous_system=cls.local_autonomous_system, ), InternetExchange( name="Example 2", slug="example-2", local_autonomous_system=cls.local_autonomous_system, ), InternetExchange( name="Example 3", slug="example-3", local_autonomous_system=cls.local_autonomous_system, ), ]) cls.internet_exchange = InternetExchange.objects.get(slug="example-1") cls.create_data = [ { "name": "Test1", "slug": "test1", "local_autonomous_system": cls.local_autonomous_system.pk, }, { "name": "Test2", "slug": "test2", "local_autonomous_system": cls.local_autonomous_system.pk, }, { "name": "Test3", "slug": "test3", "local_autonomous_system": cls.local_autonomous_system.pk, }, ]
def setUpTestData(cls): InternetExchange.objects.bulk_create([ InternetExchange(name="Internet Exchange 1", slug="ix-1"), InternetExchange(name="Internet Exchange 2", slug="ix-2"), InternetExchange(name="Internet Exchange 3", slug="ix-3"), ]) cls.form_data = { "name": "Internet Exchange 4", "slug": "ix-4", "ipv4_address": None, "ipv6_address": None, "router": None, "communities": [], "export_routing_policies": [], "import_routing_policies": [], "bgp_session_states_update": None, "check_bgp_session_states": False, "peeringdb_id": 0, "comments": "", "tags": "", } cls.bulk_edit_data = {"comments": "New comments"}