ipfabric_netbox 4.3.0b5__py3-none-any.whl → 4.3.0b7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ipfabric_netbox might be problematic. Click here for more details.
- ipfabric_netbox/__init__.py +1 -1
- ipfabric_netbox/api/serializers.py +5 -0
- ipfabric_netbox/api/views.py +47 -0
- ipfabric_netbox/choices.py +2 -2
- ipfabric_netbox/forms.py +137 -4
- ipfabric_netbox/models.py +6 -1
- ipfabric_netbox/tables.py +2 -0
- ipfabric_netbox/templates/ipfabric_netbox/ipfabricsync.html +1 -1
- ipfabric_netbox/tests/api/test_api.py +149 -22
- ipfabric_netbox/tests/test_views.py +214 -158
- ipfabric_netbox/urls.py +24 -108
- ipfabric_netbox/views.py +293 -132
- {ipfabric_netbox-4.3.0b5.dist-info → ipfabric_netbox-4.3.0b7.dist-info}/METADATA +1 -1
- {ipfabric_netbox-4.3.0b5.dist-info → ipfabric_netbox-4.3.0b7.dist-info}/RECORD +15 -15
- {ipfabric_netbox-4.3.0b5.dist-info → ipfabric_netbox-4.3.0b7.dist-info}/WHEEL +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import random
|
|
2
|
+
from datetime import timedelta
|
|
2
3
|
from unittest.mock import patch
|
|
3
4
|
from uuid import uuid4
|
|
4
5
|
|
|
@@ -63,8 +64,8 @@ class IPFabricSourceTestCase(
|
|
|
63
64
|
ViewTestCases.DeleteObjectViewTestCase,
|
|
64
65
|
ViewTestCases.ListObjectsViewTestCase,
|
|
65
66
|
ViewTestCases.BulkDeleteObjectsViewTestCase,
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
ViewTestCases.BulkRenameObjectsViewTestCase,
|
|
68
|
+
ViewTestCases.BulkEditObjectsViewTestCase,
|
|
68
69
|
# ViewTestCases.BulkImportObjectsViewTestCase,
|
|
69
70
|
):
|
|
70
71
|
model = IPFabricSource
|
|
@@ -84,7 +85,7 @@ class IPFabricSourceTestCase(
|
|
|
84
85
|
),
|
|
85
86
|
IPFabricSource(
|
|
86
87
|
name="IP Fabric Source 2",
|
|
87
|
-
type=IPFabricSourceTypeChoices.
|
|
88
|
+
type=IPFabricSourceTypeChoices.LOCAL,
|
|
88
89
|
url="https://ipfabric2.example.com",
|
|
89
90
|
status=DataSourceStatusChoices.COMPLETED,
|
|
90
91
|
parameters={"auth": "token2", "verify": False, "timeout": 60},
|
|
@@ -488,7 +489,6 @@ class IPFabricSnapshotTestCase(
|
|
|
488
489
|
self.assertTrue(response_snapshot.ipf_data.exists())
|
|
489
490
|
|
|
490
491
|
|
|
491
|
-
# TODO: Get back to these tests
|
|
492
492
|
class IPFabricDataTestCase(
|
|
493
493
|
PluginPathMixin,
|
|
494
494
|
# ViewTestCases.GetObjectViewTestCase,
|
|
@@ -607,12 +607,12 @@ class IPFabricSyncTestCase(
|
|
|
607
607
|
ViewTestCases.DeleteObjectViewTestCase,
|
|
608
608
|
ViewTestCases.ListObjectsViewTestCase,
|
|
609
609
|
ViewTestCases.BulkDeleteObjectsViewTestCase,
|
|
610
|
-
|
|
611
|
-
|
|
610
|
+
ViewTestCases.BulkRenameObjectsViewTestCase,
|
|
611
|
+
ViewTestCases.BulkEditObjectsViewTestCase,
|
|
612
612
|
# ViewTestCases.BulkImportObjectsViewTestCase,
|
|
613
613
|
):
|
|
614
614
|
model = IPFabricSync
|
|
615
|
-
user_permissions = ("ipfabric_netbox.
|
|
615
|
+
user_permissions = ("ipfabric_netbox.sync_ipfabricsync",)
|
|
616
616
|
|
|
617
617
|
@classmethod
|
|
618
618
|
def setUpTestData(cls):
|
|
@@ -657,6 +657,8 @@ class IPFabricSyncTestCase(
|
|
|
657
657
|
status=DataSourceStatusChoices.NEW,
|
|
658
658
|
parameters=get_parameters(),
|
|
659
659
|
last_synced=timezone.now(),
|
|
660
|
+
scheduled=timezone.now() + timedelta(hours=6),
|
|
661
|
+
interval=123456,
|
|
660
662
|
),
|
|
661
663
|
IPFabricSync(
|
|
662
664
|
name="Sync Job 2",
|
|
@@ -839,9 +841,9 @@ class IPFabricTransformMapGroupTestCase(
|
|
|
839
841
|
ViewTestCases.DeleteObjectViewTestCase,
|
|
840
842
|
ViewTestCases.ListObjectsViewTestCase,
|
|
841
843
|
ViewTestCases.BulkDeleteObjectsViewTestCase,
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
844
|
+
ViewTestCases.BulkRenameObjectsViewTestCase,
|
|
845
|
+
ViewTestCases.BulkEditObjectsViewTestCase,
|
|
846
|
+
ViewTestCases.BulkImportObjectsViewTestCase,
|
|
845
847
|
):
|
|
846
848
|
model = IPFabricTransformMapGroup
|
|
847
849
|
|
|
@@ -870,6 +872,21 @@ class IPFabricTransformMapGroupTestCase(
|
|
|
870
872
|
"description": "Test group description",
|
|
871
873
|
}
|
|
872
874
|
|
|
875
|
+
cls.bulk_edit_data = {
|
|
876
|
+
"description": "Bulk updated description",
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
cls.csv_data = (
|
|
880
|
+
"name,description",
|
|
881
|
+
"First imported group,import test 1",
|
|
882
|
+
"Second imported group,import test 2",
|
|
883
|
+
)
|
|
884
|
+
cls.csv_update_data = (
|
|
885
|
+
"id,name,description",
|
|
886
|
+
f"{groups[0].pk},First renamed group,changed import test 1", # noqa: E231
|
|
887
|
+
f"{groups[1].pk},Second renamed group,changed import test 2", # noqa: E231
|
|
888
|
+
)
|
|
889
|
+
|
|
873
890
|
|
|
874
891
|
class IPFabricTransformMapTestCase(
|
|
875
892
|
PluginPathMixin,
|
|
@@ -880,9 +897,9 @@ class IPFabricTransformMapTestCase(
|
|
|
880
897
|
ViewTestCases.DeleteObjectViewTestCase,
|
|
881
898
|
ViewTestCases.ListObjectsViewTestCase,
|
|
882
899
|
ViewTestCases.BulkDeleteObjectsViewTestCase,
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
900
|
+
ViewTestCases.BulkRenameObjectsViewTestCase,
|
|
901
|
+
ViewTestCases.BulkEditObjectsViewTestCase,
|
|
902
|
+
ViewTestCases.BulkImportObjectsViewTestCase,
|
|
886
903
|
):
|
|
887
904
|
model = IPFabricTransformMap
|
|
888
905
|
user_permissions = (
|
|
@@ -893,7 +910,11 @@ class IPFabricTransformMapTestCase(
|
|
|
893
910
|
@classmethod
|
|
894
911
|
def setUpTestData(cls):
|
|
895
912
|
# Number of IPFabricTransformMaps created during migration
|
|
896
|
-
|
|
913
|
+
# Hardcoded since we need to make sure we have the correct count
|
|
914
|
+
cls.default_maps = IPFabricTransformMap.objects.filter(group__isnull=True)
|
|
915
|
+
assert cls.default_maps.count() == 14
|
|
916
|
+
# Remove all transform maps created in migrations to not interfere with tests
|
|
917
|
+
IPFabricTransformMap.objects.filter(group__isnull=True).delete()
|
|
897
918
|
|
|
898
919
|
# Create required dependencies
|
|
899
920
|
group = IPFabricTransformMapGroup.objects.create(
|
|
@@ -904,14 +925,16 @@ class IPFabricTransformMapTestCase(
|
|
|
904
925
|
name="Test Cloning Group",
|
|
905
926
|
description="Test group for cloning transform maps",
|
|
906
927
|
)
|
|
928
|
+
bulk_edit_group = IPFabricTransformMapGroup.objects.create(
|
|
929
|
+
name="Test Bulk Edit Group",
|
|
930
|
+
description="Test group for bulk editing transform maps",
|
|
931
|
+
)
|
|
907
932
|
|
|
908
|
-
# Create IPFabricTransformMap instances with groups for testing
|
|
909
933
|
maps = (
|
|
910
934
|
IPFabricTransformMap(
|
|
911
935
|
name="Device Transform Map",
|
|
912
936
|
source_model="device",
|
|
913
937
|
target_model=ContentType.objects.get(app_label="dcim", model="device"),
|
|
914
|
-
group=group,
|
|
915
938
|
),
|
|
916
939
|
IPFabricTransformMap(
|
|
917
940
|
name="Site Transform Map",
|
|
@@ -919,10 +942,30 @@ class IPFabricTransformMapTestCase(
|
|
|
919
942
|
target_model=ContentType.objects.get(app_label="dcim", model="site"),
|
|
920
943
|
group=group,
|
|
921
944
|
),
|
|
945
|
+
IPFabricTransformMap(
|
|
946
|
+
name="VLAN Transform Map",
|
|
947
|
+
source_model="vlan",
|
|
948
|
+
target_model=ContentType.objects.get(app_label="ipam", model="vlan"),
|
|
949
|
+
group=group,
|
|
950
|
+
),
|
|
922
951
|
)
|
|
923
952
|
for map_obj in maps:
|
|
924
953
|
map_obj.save()
|
|
925
954
|
|
|
955
|
+
IPFabricTransformField.objects.create(
|
|
956
|
+
transform_map=maps[0],
|
|
957
|
+
source_field="hostname",
|
|
958
|
+
target_field="name",
|
|
959
|
+
template="{{ object.hostname }}",
|
|
960
|
+
)
|
|
961
|
+
IPFabricRelationshipField.objects.create(
|
|
962
|
+
transform_map=maps[0],
|
|
963
|
+
source_model=ContentType.objects.get(app_label="dcim", model="site"),
|
|
964
|
+
target_field="site",
|
|
965
|
+
template="{{ object.siteName }}",
|
|
966
|
+
coalesce=True,
|
|
967
|
+
)
|
|
968
|
+
|
|
926
969
|
cls.form_data = {
|
|
927
970
|
"name": "Test Transform Map X",
|
|
928
971
|
"source_model": "device",
|
|
@@ -932,6 +975,22 @@ class IPFabricTransformMapTestCase(
|
|
|
932
975
|
"group": group.pk,
|
|
933
976
|
}
|
|
934
977
|
|
|
978
|
+
cls.bulk_edit_data = {
|
|
979
|
+
"group": bulk_edit_group.pk,
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
cls.csv_data = (
|
|
983
|
+
"name,source_model,target_model,group",
|
|
984
|
+
"Manufacturer Transform Map,device,dcim.manufacturer,Test Group",
|
|
985
|
+
"IPAddress Transform Map,ipaddress,ipam.ipaddress,Test Group",
|
|
986
|
+
"Platform Transform Map,device,dcim.platform,",
|
|
987
|
+
)
|
|
988
|
+
cls.csv_update_data = (
|
|
989
|
+
"id,name,source_model,target_model,group",
|
|
990
|
+
f"{maps[0].pk},Prefix Transform Map,prefix,ipam.prefix,Test Group", # noqa: E231
|
|
991
|
+
f"{maps[1].pk},Manufacturer Transform Map,device,dcim.manufacturer,", # noqa: E231
|
|
992
|
+
)
|
|
993
|
+
|
|
935
994
|
@override_settings(EXEMPT_VIEW_PERMISSIONS=["*"])
|
|
936
995
|
def test_get_relationships(self):
|
|
937
996
|
transform_map = self._get_queryset().first()
|
|
@@ -1166,7 +1225,8 @@ class IPFabricTransformMapTestCase(
|
|
|
1166
1225
|
# Should show form errors
|
|
1167
1226
|
self.assertHttpStatus(response, 200)
|
|
1168
1227
|
self.assertContains(
|
|
1169
|
-
response,
|
|
1228
|
+
response,
|
|
1229
|
+
"A transform map with group 'Test Group' and target model 'DCIM | site' already exists.",
|
|
1170
1230
|
)
|
|
1171
1231
|
self.assertIn("X-Debug-HTMX-Partial", response)
|
|
1172
1232
|
|
|
@@ -1237,10 +1297,7 @@ class IPFabricTransformMapTestCase(
|
|
|
1237
1297
|
@override_settings(EXEMPT_VIEW_PERMISSIONS=["*"])
|
|
1238
1298
|
def test_restore_view_post_success(self):
|
|
1239
1299
|
"""Test POST request to restore view successfully deletes ungrouped maps and rebuilds them."""
|
|
1240
|
-
|
|
1241
|
-
self.assertEqual(len(default_maps), self.default_maps_count)
|
|
1242
|
-
|
|
1243
|
-
# Remove all transform maps created in migrations
|
|
1300
|
+
# Remove all existing transform maps
|
|
1244
1301
|
IPFabricTransformMap.objects.filter(group__isnull=True).delete()
|
|
1245
1302
|
self.assertEqual(
|
|
1246
1303
|
IPFabricTransformMap.objects.filter(group__isnull=True).count(), 0
|
|
@@ -1258,9 +1315,9 @@ class IPFabricTransformMapTestCase(
|
|
|
1258
1315
|
# Verify ungrouped transform maps were restored
|
|
1259
1316
|
self.assertEqual(
|
|
1260
1317
|
IPFabricTransformMap.objects.filter(group__isnull=True).count(),
|
|
1261
|
-
self.
|
|
1318
|
+
self.default_maps.count(),
|
|
1262
1319
|
)
|
|
1263
|
-
for map in default_maps:
|
|
1320
|
+
for map in self.default_maps:
|
|
1264
1321
|
self.assertTrue(
|
|
1265
1322
|
IPFabricTransformMap.objects.filter(
|
|
1266
1323
|
name=map.name,
|
|
@@ -1288,140 +1345,139 @@ class IPFabricTransformMapTestCase(
|
|
|
1288
1345
|
self.assertIn(response.status_code, [302, 403])
|
|
1289
1346
|
|
|
1290
1347
|
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
#
|
|
1294
|
-
#
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
#
|
|
1299
|
-
|
|
1300
|
-
#
|
|
1301
|
-
#
|
|
1302
|
-
#
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
#
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
#
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
#
|
|
1360
|
-
#
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
#
|
|
1365
|
-
|
|
1366
|
-
#
|
|
1367
|
-
#
|
|
1368
|
-
#
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
#
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
#
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
# }
|
|
1348
|
+
class IPFabricTransformFieldTestCase(
|
|
1349
|
+
PluginPathMixin,
|
|
1350
|
+
# ViewTestCases.GetObjectViewTestCase,
|
|
1351
|
+
# ViewTestCases.GetObjectChangelogViewTestCase,
|
|
1352
|
+
ViewTestCases.CreateObjectViewTestCase,
|
|
1353
|
+
ViewTestCases.EditObjectViewTestCase,
|
|
1354
|
+
ViewTestCases.DeleteObjectViewTestCase,
|
|
1355
|
+
# ViewTestCases.ListObjectsViewTestCase,
|
|
1356
|
+
ViewTestCases.BulkDeleteObjectsViewTestCase,
|
|
1357
|
+
# ViewTestCases.BulkRenameObjectsViewTestCase,
|
|
1358
|
+
# ViewTestCases.BulkEditObjectsViewTestCase,
|
|
1359
|
+
# ViewTestCases.BulkImportObjectsViewTestCase,
|
|
1360
|
+
):
|
|
1361
|
+
model = IPFabricTransformField
|
|
1362
|
+
|
|
1363
|
+
@classmethod
|
|
1364
|
+
def setUpTestData(cls):
|
|
1365
|
+
# Create required dependencies
|
|
1366
|
+
group = IPFabricTransformMapGroup.objects.create(
|
|
1367
|
+
name="Test Group",
|
|
1368
|
+
description="Test group for transform fields",
|
|
1369
|
+
)
|
|
1370
|
+
|
|
1371
|
+
transform_map = IPFabricTransformMap.objects.create(
|
|
1372
|
+
name="Test Transform Map",
|
|
1373
|
+
source_model="devices",
|
|
1374
|
+
target_model=ContentType.objects.get(app_label="dcim", model="device"),
|
|
1375
|
+
group=group,
|
|
1376
|
+
)
|
|
1377
|
+
|
|
1378
|
+
# Create three IPFabricTransformField instances for testing
|
|
1379
|
+
fields = (
|
|
1380
|
+
IPFabricTransformField(
|
|
1381
|
+
transform_map=transform_map,
|
|
1382
|
+
source_field="hostname",
|
|
1383
|
+
target_field="name",
|
|
1384
|
+
coalesce=False,
|
|
1385
|
+
template="{{ object.hostname }}",
|
|
1386
|
+
),
|
|
1387
|
+
IPFabricTransformField(
|
|
1388
|
+
transform_map=transform_map,
|
|
1389
|
+
source_field="vendor",
|
|
1390
|
+
target_field="manufacturer",
|
|
1391
|
+
coalesce=True,
|
|
1392
|
+
template="{{ object.vendor }}",
|
|
1393
|
+
),
|
|
1394
|
+
IPFabricTransformField(
|
|
1395
|
+
transform_map=transform_map,
|
|
1396
|
+
source_field="model",
|
|
1397
|
+
target_field="device_type",
|
|
1398
|
+
coalesce=False,
|
|
1399
|
+
template="{{ object.model }}",
|
|
1400
|
+
),
|
|
1401
|
+
)
|
|
1402
|
+
for field in fields:
|
|
1403
|
+
field.save()
|
|
1404
|
+
|
|
1405
|
+
cls.form_data = {
|
|
1406
|
+
"transform_map": transform_map.pk,
|
|
1407
|
+
"source_field": "serial_number",
|
|
1408
|
+
"target_field": "serial",
|
|
1409
|
+
"coalesce": False,
|
|
1410
|
+
"template": "{{ object.serial_number }}",
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
|
|
1414
|
+
class IPFabricRelationshipFieldTestCase(
|
|
1415
|
+
PluginPathMixin,
|
|
1416
|
+
# ViewTestCases.GetObjectViewTestCase,
|
|
1417
|
+
# ViewTestCases.GetObjectChangelogViewTestCase,
|
|
1418
|
+
ViewTestCases.CreateObjectViewTestCase,
|
|
1419
|
+
ViewTestCases.EditObjectViewTestCase,
|
|
1420
|
+
ViewTestCases.DeleteObjectViewTestCase,
|
|
1421
|
+
# ViewTestCases.ListObjectsViewTestCase,
|
|
1422
|
+
ViewTestCases.BulkDeleteObjectsViewTestCase,
|
|
1423
|
+
# ViewTestCases.BulkRenameObjectsViewTestCase,
|
|
1424
|
+
# ViewTestCases.BulkEditObjectsViewTestCase,
|
|
1425
|
+
# ViewTestCases.BulkImportObjectsViewTestCase,
|
|
1426
|
+
):
|
|
1427
|
+
model = IPFabricRelationshipField
|
|
1428
|
+
|
|
1429
|
+
@classmethod
|
|
1430
|
+
def setUpTestData(cls):
|
|
1431
|
+
# Create required dependencies
|
|
1432
|
+
group = IPFabricTransformMapGroup.objects.create(
|
|
1433
|
+
name="Test Group",
|
|
1434
|
+
description="Test group for relationship fields",
|
|
1435
|
+
)
|
|
1436
|
+
|
|
1437
|
+
device_ct = ContentType.objects.get(app_label="dcim", model="device")
|
|
1438
|
+
site_ct = ContentType.objects.get(app_label="dcim", model="site")
|
|
1439
|
+
|
|
1440
|
+
transform_map = IPFabricTransformMap.objects.create(
|
|
1441
|
+
name="Test Transform Map",
|
|
1442
|
+
source_model="devices",
|
|
1443
|
+
target_model=device_ct,
|
|
1444
|
+
group=group,
|
|
1445
|
+
)
|
|
1446
|
+
|
|
1447
|
+
# Create three IPFabricRelationshipField instances for testing
|
|
1448
|
+
fields = (
|
|
1449
|
+
IPFabricRelationshipField(
|
|
1450
|
+
transform_map=transform_map,
|
|
1451
|
+
source_model=site_ct,
|
|
1452
|
+
target_field="site",
|
|
1453
|
+
coalesce=False,
|
|
1454
|
+
template="{{ object.site_id }}",
|
|
1455
|
+
),
|
|
1456
|
+
IPFabricRelationshipField(
|
|
1457
|
+
transform_map=transform_map,
|
|
1458
|
+
source_model=device_ct,
|
|
1459
|
+
target_field="parent_device",
|
|
1460
|
+
coalesce=True,
|
|
1461
|
+
template="{{ object.parent_id }}",
|
|
1462
|
+
),
|
|
1463
|
+
IPFabricRelationshipField(
|
|
1464
|
+
transform_map=transform_map,
|
|
1465
|
+
source_model=site_ct,
|
|
1466
|
+
target_field="location",
|
|
1467
|
+
coalesce=False,
|
|
1468
|
+
template="{{ object.location_id }}",
|
|
1469
|
+
),
|
|
1470
|
+
)
|
|
1471
|
+
for field in fields:
|
|
1472
|
+
field.save()
|
|
1473
|
+
|
|
1474
|
+
cls.form_data = {
|
|
1475
|
+
"transform_map": transform_map.pk,
|
|
1476
|
+
"source_model": site_ct.pk,
|
|
1477
|
+
"target_field": "site",
|
|
1478
|
+
"coalesce": False,
|
|
1479
|
+
"template": "{{ object.site_id }}",
|
|
1480
|
+
}
|
|
1425
1481
|
|
|
1426
1482
|
|
|
1427
1483
|
class IPFabricIngestionTestCase(
|
|
@@ -1432,7 +1488,7 @@ class IPFabricIngestionTestCase(
|
|
|
1432
1488
|
# ViewTestCases.EditObjectViewTestCase,
|
|
1433
1489
|
# ViewTestCases.DeleteObjectViewTestCase,
|
|
1434
1490
|
ViewTestCases.ListObjectsViewTestCase,
|
|
1435
|
-
|
|
1491
|
+
ViewTestCases.BulkDeleteObjectsViewTestCase,
|
|
1436
1492
|
# ViewTestCases.BulkRenameObjectsViewTestCase,
|
|
1437
1493
|
# ViewTestCases.BulkEditObjectsViewTestCase,
|
|
1438
1494
|
# ViewTestCases.BulkImportObjectsViewTestCase,
|