Skip to content

Commit

Permalink
Fixes L2VPN view tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jnovinger committed Mar 3, 2025
1 parent 0c9f59b commit d033ea5
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions netbox/vpn/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,16 +574,25 @@ def setUpTestData(cls):
RouteTarget.objects.bulk_create(rts)

l2vpns = (
L2VPN(name='L2VPN 1', slug='l2vpn-1', type=L2VPNTypeChoices.TYPE_VXLAN, identifier='650001'),
L2VPN(name='L2VPN 2', slug='l2vpn-2', type=L2VPNTypeChoices.TYPE_VXLAN, identifier='650002'),
L2VPN(name='L2VPN 3', slug='l2vpn-3', type=L2VPNTypeChoices.TYPE_VXLAN, identifier='650003')
L2VPN(
name='L2VPN 1', slug='l2vpn-1', status=L2VPNStatusChoices.STATUS_ACTIVE,
type=L2VPNTypeChoices.TYPE_VXLAN, identifier='650001'
),
L2VPN(
name='L2VPN 2', slug='l2vpn-2', status=L2VPNStatusChoices.STATUS_DECOMMISSIONED,
type=L2VPNTypeChoices.TYPE_VXLAN, identifier='650002'
),
L2VPN(
name='L2VPN 3', slug='l2vpn-3', status=L2VPNStatusChoices.STATUS_PLANNED,
type=L2VPNTypeChoices.TYPE_VXLAN, identifier='650003'
)
)
L2VPN.objects.bulk_create(l2vpns)

cls.csv_data = (
'name,slug,type,identifier',
'L2VPN 5,l2vpn-5,vxlan,456',
'L2VPN 6,l2vpn-6,vxlan,444',
'name,status,slug,type,identifier',
'L2VPN 5,active,l2vpn-5,vxlan,456',
'L2VPN 6,planned,l2vpn-6,vxlan,444',
)

cls.csv_update_data = (
Expand All @@ -594,12 +603,14 @@ def setUpTestData(cls):

cls.bulk_edit_data = {
'description': 'New Description',
'status': L2VPNStatusChoices.STATUS_DECOMMISSIONED,
}

cls.form_data = {
'name': 'L2VPN 8',
'slug': 'l2vpn-8',
'type': L2VPNTypeChoices.TYPE_VXLAN,
'status': L2VPNStatusChoices.STATUS_PLANNED,
'identifier': 123,
'description': 'Description',
'import_targets': [rts[0].pk],
Expand Down

0 comments on commit d033ea5

Please sign in to comment.