fix: instance_names in tests must be alphanumeric and be < 20 chars
closes: https://gitea.gna.org/Hostea/dashboard/issues/57pull/58/head
parent
3019d9d739
commit
1792713952
|
@ -49,7 +49,7 @@ class BillingTest(TestCase):
|
||||||
def test_payments(self):
|
def test_payments(self):
|
||||||
c = Client()
|
c = Client()
|
||||||
login_util(self, c, "accounts.home")
|
login_util(self, c, "accounts.home")
|
||||||
instance_name = "test_payments"
|
instance_name = "tpayments"
|
||||||
create_instance_util(
|
create_instance_util(
|
||||||
t=self, c=c, instance_name=instance_name, config=self.instance_config[0]
|
t=self, c=c, instance_name=instance_name, config=self.instance_config[0]
|
||||||
)
|
)
|
||||||
|
@ -154,7 +154,7 @@ class GenerateInvoiceCommand(TestCase):
|
||||||
def test_cmd(self):
|
def test_cmd(self):
|
||||||
c = Client()
|
c = Client()
|
||||||
login_util(self, c, "accounts.home")
|
login_util(self, c, "accounts.home")
|
||||||
instance_name = "test_generate_invoice_cmd"
|
instance_name = "tgeninvmd"
|
||||||
create_instance_util(
|
create_instance_util(
|
||||||
t=self, c=c, instance_name=instance_name, config=self.instance_config[0]
|
t=self, c=c, instance_name=instance_name, config=self.instance_config[0]
|
||||||
)
|
)
|
||||||
|
|
|
@ -236,14 +236,14 @@ class CreateInstance(TestCase):
|
||||||
self.assertEqual(str.encode(test) in resp.content, True)
|
self.assertEqual(str.encode(test) in resp.content, True)
|
||||||
|
|
||||||
# create instance
|
# create instance
|
||||||
|
instance_name = "testirenrs"
|
||||||
payload = {
|
payload = {
|
||||||
"name": "test_create_instance_renders",
|
"name": instance_name,
|
||||||
"configuration": self.instance_config[0].name,
|
"configuration": self.instance_config[0].name,
|
||||||
}
|
}
|
||||||
|
|
||||||
self.assertEqual(Instance.objects.filter(name=payload["name"]).exists(), False)
|
self.assertEqual(Instance.objects.filter(name=payload["name"]).exists(), False)
|
||||||
|
|
||||||
instance_name = "test_create_instance_renders"
|
|
||||||
create_instance_util(
|
create_instance_util(
|
||||||
t=self, c=c, instance_name=instance_name, config=self.instance_config[0]
|
t=self, c=c, instance_name=instance_name, config=self.instance_config[0]
|
||||||
)
|
)
|
||||||
|
|
|
@ -89,7 +89,7 @@ def create_instance(request):
|
||||||
return redirect(reverse("billing.invoice.generate", args=(instance.name,)))
|
return redirect(reverse("billing.invoice.generate", args=(instance.name,)))
|
||||||
except VmException as e:
|
except VmException as e:
|
||||||
ctx = get_ctx()
|
ctx = get_ctx()
|
||||||
reason = e.error
|
reason = e.code.value
|
||||||
|
|
||||||
ctx["error"] = {
|
ctx["error"] = {
|
||||||
"title": "Can't create instance",
|
"title": "Can't create instance",
|
||||||
|
|
|
@ -185,7 +185,7 @@ class InfraUtilTest(TestCase):
|
||||||
"""
|
"""
|
||||||
c = Client()
|
c = Client()
|
||||||
login_util(self, c, "accounts.home")
|
login_util(self, c, "accounts.home")
|
||||||
instance_name = "test_vm_delete_payments"
|
instance_name = "trmpayments"
|
||||||
|
|
||||||
infra = Infra()
|
infra = Infra()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue