style: apply ruff and django-upgrade

This commit is contained in:
ponas committed 2026-11-02 01:05:51 +01:00
1 parent 1e128e8d9b
commit be0e621b28
18 files changed
+149 -212

No files matched your search

-8
View File
@@ -53,11 +53,3 @@ def db_domain(db, tmp_path):
)
DomainTxtRecord.objects.create(domain=domain, name="@", target='"v=spf1 mx ~all"')
return domain
def load_command_class():
path = pathlib.Path(__file__).parent.parent / "mdb/management/commands/zone-sync.py"
spec = importlib.util.spec_from_file_location("zone_sync_command", path)
mod = importlib.util.module_from_spec(spec)
spec.loader.exec_module(mod)
return mod.Command
+2 -4
View File
@@ -35,11 +35,9 @@ def test_validate_puppet_host_by_secret(api_client, user_with_token, host):
_, token = user_with_token
data = {
"pxe_key": host.pxe_key,
"certname": "{}.{}".format(
host.hostname, host.interface_set.first().domain.domain_name
),
"certname": f"{host.hostname}.{host.interface_set.first().domain.domain_name}",
}
api_client.credentials(HTTP_AUTHORIZATION="Token {}".format(token.key))
api_client.credentials(HTTP_AUTHORIZATION=f"Token {token.key}")
res = api_client.post(reverse("api-validate-host-secret"), data, format="json")
assert res.status_code == 200, res.content
assert not Host.objects.get(pk=host.pk).pxe_installable
+1
View File
@@ -3,6 +3,7 @@ from io import StringIO
from unittest.mock import MagicMock, patch
import pytest
from mdb.management.commands.zone_sync import Command as CommandClass
from mdb.services.zone_sync import ZoneSyncService