diff --git a/billing/tests.py b/billing/tests.py index 071764a..2499571 100644 --- a/billing/tests.py +++ b/billing/tests.py @@ -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] ) diff --git a/dash/tests.py b/dash/tests.py index 52a9c91..2308412 100644 --- a/dash/tests.py +++ b/dash/tests.py @@ -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] ) diff --git a/dash/views.py b/dash/views.py index 28be20d..cc490b6 100644 --- a/dash/views.py +++ b/dash/views.py @@ -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", diff --git a/infrastructure/tests.py b/infrastructure/tests.py index bc06380..b7d83e7 100644 --- a/infrastructure/tests.py +++ b/infrastructure/tests.py @@ -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()