Commit 5f72d598 by Czémán Arnold

dashboard: fix some tests

parent 996d1360
......@@ -175,7 +175,8 @@
"priority": 10,
"template": null,
"access_method": "nx",
"lease": 1,
"lease": 1,
"datastore": 1,
"node": null,
"description": "",
"arch": "x86_64",
......@@ -205,7 +206,8 @@
"priority": 10,
"template": null,
"access_method": "nx",
"lease": 1,
"lease": 1,
"datastore": 1,
"node": null,
"description": "",
"arch": "x86_64",
......@@ -313,6 +315,7 @@
"arch": "x86_64",
"max_ram_size": 1024,
"lease": 1,
"datastore": 1,
"owner": 1
}
}
......
......@@ -343,8 +343,9 @@ class CircleSeleniumMixin(SeleniumMixin):
'Cannot save a vm as a template')
def create_base_template(self, name=None, architecture="x86-64",
method=None, op_system=None, lease=None,
network="vm"):
method=None, op_system=None,
datastore="default",
lease=None, network="vm"):
if name is None:
name = "new_%s" % self.conf.client_name
if op_system is None:
......@@ -370,6 +371,8 @@ class CircleSeleniumMixin(SeleniumMixin):
system_name.clear()
system_name.send_keys(op_system)
self.select_option(self.driver.find_element_by_id(
"id_datastore"), datastore)
self.select_option(self.driver.find_element_by_id(
"id_lease"), lease)
self.select_option(self.driver.find_element_by_id(
"id_networks"), network)
......
......@@ -253,7 +253,8 @@ class VmDetailTest(LoginMixin, MockCeleryMixin, TestCase):
tmpl.set_level(self.u1, 'owner')
Vlan.objects.get(id=1).set_level(self.u1, 'user')
kwargs = tmpl.__dict__.copy()
kwargs.update(name='t1', lease=1, disks=1, raw_data='tst1')
kwargs.update(name='t1', lease=1, disks=1,
raw_data='tst1', datastore=1)
response = c.post('/dashboard/template/1/', kwargs)
self.assertEqual(response.status_code, 302)
self.assertEqual(InstanceTemplate.objects.get(id=1).raw_data,
......@@ -264,7 +265,7 @@ class VmDetailTest(LoginMixin, MockCeleryMixin, TestCase):
self.login(c, 'superuser')
kwargs = InstanceTemplate.objects.get(id=1).__dict__.copy()
kwargs.update(name='t2', lease=1, disks=1,
raw_data='<devices></devices>')
raw_data='<devices></devices>', datastore=1)
response = c.post('/dashboard/template/1/', kwargs)
self.assertEqual(response.status_code, 302)
self.assertEqual(InstanceTemplate.objects.get(id=1).raw_data,
......
......@@ -11,7 +11,7 @@ django-braces==1.8.0
django-crispy-forms==1.6.0
django-model-utils==2.2
djangosaml2==0.13.0
django-sizefield==0.7
django-sizefield==0.9.1
git+https://git.ik.bme.hu/circle/django-sshkey.git
django-statici18n==1.1.3
django-tables2==0.16.0
......
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