Merge pull request 'fix: instance_names in tests must be alphanumeric and be < 20 chars' (#58) from fix-hostname-validation into master
ci/woodpecker/push/woodpecker Pipeline was successful Details

Reviewed-on: https://gitea.gna.org/Hostea/dashboard/pulls/58
pull/54/head
Loïc Dachary 2022-09-11 18:13:12 -04:00
commit 5b7cf06c7a
4 changed files with 6 additions and 6 deletions

View File

@ -49,7 +49,7 @@ class BillingTest(TestCase):
def test_payments(self):
c = Client()
login_util(self, c, "accounts.home")
instance_name = "test_payments"
instance_name = "tpayments"
create_instance_util(
t=self, c=c, instance_name=instance_name, config=self.instance_config[0]
)
@ -154,7 +154,7 @@ class GenerateInvoiceCommand(TestCase):
def test_cmd(self):
c = Client()
login_util(self, c, "accounts.home")
instance_name = "test_generate_invoice_cmd"
instance_name = "tgeninvmd"
create_instance_util(
t=self, c=c, instance_name=instance_name, config=self.instance_config[0]
)

View File

@ -236,14 +236,14 @@ class CreateInstance(TestCase):
self.assertEqual(str.encode(test) in resp.content, True)
# create instance
instance_name = "testirenrs"
payload = {
"name": "test_create_instance_renders",
"name": instance_name,
"configuration": self.instance_config[0].name,
}
self.assertEqual(Instance.objects.filter(name=payload["name"]).exists(), False)
instance_name = "test_create_instance_renders"
create_instance_util(
t=self, c=c, instance_name=instance_name, config=self.instance_config[0]
)

View File

@ -89,7 +89,7 @@ def create_instance(request):
return redirect(reverse("billing.invoice.generate", args=(instance.name,)))
except VmException as e:
ctx = get_ctx()
reason = e.error
reason = e.code.value
ctx["error"] = {
"title": "Can't create instance",

View File

@ -185,7 +185,7 @@ class InfraUtilTest(TestCase):
"""
c = Client()
login_util(self, c, "accounts.home")
instance_name = "test_vm_delete_payments"
instance_name = "trmpayments"
infra = Infra()