mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-09 00:58:16 -06:00
16261 fixup test
This commit is contained in:
parent
d93569a5e1
commit
8f81418753
@ -649,7 +649,7 @@ class IPAddressTest(APIViewTestCases.APIViewTestCase):
|
||||
'description': 'New description',
|
||||
}
|
||||
graphql_filter = {
|
||||
'address': '192.168.0.1/24',
|
||||
'address': {'lookup': 'i_exact', 'value': '192.168.0.1/24'},
|
||||
}
|
||||
|
||||
@classmethod
|
||||
|
@ -496,7 +496,14 @@ class APIViewTestCases:
|
||||
Create a filtered query: i.e. ip_address_list(filters: {address: "1.1.1.1/24"}){.
|
||||
"""
|
||||
if filters:
|
||||
filter_string = ', '.join(f'{k}: "{v}"' for k, v in filters.items())
|
||||
for field_name, params in filters.items():
|
||||
lookup = params['lookup']
|
||||
value = params['value']
|
||||
if lookup:
|
||||
query = f'{{{lookup}: "{value}"}}'
|
||||
filter_string = f'{field_name}: {query}'
|
||||
else:
|
||||
filter_string = f'{field_name}: "{value}"'
|
||||
filter_string = f'(filters: {{{filter_string}}})'
|
||||
else:
|
||||
filter_string = ''
|
||||
|
Loading…
Reference in New Issue
Block a user