Skip to content

Commit

Permalink
Make linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
jorund1 committed Aug 23, 2024
1 parent 6251877 commit 4b269d1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/integration/seeddb_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ def test_log_netbox_change_should_not_crash(admin_account, netbox):
assert log_netbox_change(admin_account, old, new) is None


def test_empty_function_field_in_netbox_edit_form_should_delete_respective_netboxinfo_instance(netbox, db, client):
def test_empty_function_field_in_netbox_edit_form_should_delete_respective_netboxinfo_instance(
netbox, db, client
):
"""
Empty function fields in the webform should cause the function's
corresponding NetboxInfo to be deleted; This is the correct thing
Expand All @@ -122,6 +124,7 @@ def test_empty_function_field_in_netbox_edit_form_should_delete_respective_netbo
string.
"""
url = reverse('seeddb-netbox-edit', args=(netbox.id,))

def post(func):
return client.post(
url,
Expand All @@ -139,6 +142,9 @@ def post(func):
post("")
assert len(NetboxInfo.objects.filter(netbox=netbox, variable='function')) == 0
post("foo")
assert NetboxInfo.objects.filter(netbox=netbox, variable='function').get().value == 'foo'
assert (
NetboxInfo.objects.filter(netbox=netbox, variable='function').get().value
== 'foo'
)
post("")
assert len(NetboxInfo.objects.filter(netbox=netbox, variable='function')) == 0

0 comments on commit 4b269d1

Please sign in to comment.