Commit 96215507 by Kálmán Viktor

dashboard: fix vm/template create tests

parent 7278c20e
......@@ -1497,7 +1497,7 @@
"boot_menu": false,
"ram_size": 1024,
"modified": "2014-01-24T00:58:19.654Z",
"system": "",
"system": "bubuntu",
"priority": 20,
"access_method": "ssh",
"raw_data": "",
......
......@@ -187,6 +187,7 @@ class VmDetailTest(LoginMixin, TestCase):
Vlan.objects.get(id=1).set_level(self.u1, 'user')
response = c.post('/dashboard/vm/create/',
{'template': 1,
'system': "bubi",
'cpu_priority': 1, 'cpu_count': 1,
'ram_size': 1000})
self.assertEqual(response.status_code, 403)
......@@ -199,6 +200,7 @@ class VmDetailTest(LoginMixin, TestCase):
Vlan.objects.get(id=1).set_level(self.u1, 'user')
response = c.post('/dashboard/vm/create/',
{'template': 1,
'system': "bubi",
'cpu_priority': 1, 'cpu_count': 1,
'ram_size': 1000})
self.assertEqual(response.status_code, 302)
......@@ -208,6 +210,7 @@ class VmDetailTest(LoginMixin, TestCase):
self.login(c, 'superuser')
response = c.post('/dashboard/vm/create/',
{'template': 1,
'system': "bubi",
'cpu_priority': 1, 'cpu_count': 1,
'ram_size': 1000})
self.assertEqual(response.status_code, 302)
......
......@@ -378,7 +378,7 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel,
# prepare parameters
common_fields = ['name', 'description', 'num_cores', 'ram_size',
'max_ram_size', 'arch', 'priority', 'boot_menu',
'raw_data', 'lease', 'access_method']
'raw_data', 'lease', 'access_method', 'system']
params = dict(template=template, owner=owner, pw=pwgen())
params.update([(f, getattr(template, f)) for f in common_fields])
params.update(kwargs) # override defaults w/ user supplied values
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment