Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
* Fix Serializer
* Fix test data
  • Loading branch information
DanSheps committed Sep 16, 2024
1 parent 59243b4 commit 78c8ede
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions netbox_routing/api/_serializers/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

class StaticRouteSerializer(NetBoxModelSerializer):
url = serializers.HyperlinkedIdentityField(view_name='plugins-api:netbox_routing-api:staticroute-detail')
devices = DeviceSerializer(many=True, nested=True, required=False)
vrf = VRFSerializer(nested=True, required=False)
devices = DeviceSerializer(many=True, nested=True, required=False, allow_null=True)
vrf = VRFSerializer(nested=True, required=False, allow_null=True)
next_hop = IPAddressField()

class Meta:
Expand Down
2 changes: 1 addition & 1 deletion netbox_routing/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def setUpTestData(cls):
'devices': [device.pk],
'vrf': vrf.pk,
'prefix': '0.0.0.0/0',
'next_hop': '10.10.10.1',
'next_hop': '10.10.10.2',
'metric': 1,
'permanent': True
},
Expand Down

0 comments on commit 78c8ede

Please sign in to comment.