Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5f72d598
authored
Apr 28, 2016
by
Czémán Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: fix some tests
parent
996d1360
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
7 deletions
+14
-7
circle/dashboard/fixtures/test-vm-fixture.json
+5
-2
circle/dashboard/tests/selenium/util.py
+5
-2
circle/dashboard/tests/test_views.py
+3
-2
requirements/base.txt
+1
-1
No files found.
circle/dashboard/fixtures/test-vm-fixture.json
View file @
5f72d598
...
@@ -175,7 +175,8 @@
...
@@ -175,7 +175,8 @@
"priority"
:
10
,
"priority"
:
10
,
"template"
:
null
,
"template"
:
null
,
"access_method"
:
"nx"
,
"access_method"
:
"nx"
,
"lease"
:
1
,
"lease"
:
1
,
"datastore"
:
1
,
"node"
:
null
,
"node"
:
null
,
"description"
:
""
,
"description"
:
""
,
"arch"
:
"x86_64"
,
"arch"
:
"x86_64"
,
...
@@ -205,7 +206,8 @@
...
@@ -205,7 +206,8 @@
"priority"
:
10
,
"priority"
:
10
,
"template"
:
null
,
"template"
:
null
,
"access_method"
:
"nx"
,
"access_method"
:
"nx"
,
"lease"
:
1
,
"lease"
:
1
,
"datastore"
:
1
,
"node"
:
null
,
"node"
:
null
,
"description"
:
""
,
"description"
:
""
,
"arch"
:
"x86_64"
,
"arch"
:
"x86_64"
,
...
@@ -313,6 +315,7 @@
...
@@ -313,6 +315,7 @@
"arch"
:
"x86_64"
,
"arch"
:
"x86_64"
,
"max_ram_size"
:
1024
,
"max_ram_size"
:
1024
,
"lease"
:
1
,
"lease"
:
1
,
"datastore"
:
1
,
"owner"
:
1
"owner"
:
1
}
}
}
}
...
...
circle/dashboard/tests/selenium/util.py
View file @
5f72d598
...
@@ -343,8 +343,9 @@ class CircleSeleniumMixin(SeleniumMixin):
...
@@ -343,8 +343,9 @@ class CircleSeleniumMixin(SeleniumMixin):
'Cannot save a vm as a template'
)
'Cannot save a vm as a template'
)
def
create_base_template
(
self
,
name
=
None
,
architecture
=
"x86-64"
,
def
create_base_template
(
self
,
name
=
None
,
architecture
=
"x86-64"
,
method
=
None
,
op_system
=
None
,
lease
=
None
,
method
=
None
,
op_system
=
None
,
network
=
"vm"
):
datastore
=
"default"
,
lease
=
None
,
network
=
"vm"
):
if
name
is
None
:
if
name
is
None
:
name
=
"new_
%
s"
%
self
.
conf
.
client_name
name
=
"new_
%
s"
%
self
.
conf
.
client_name
if
op_system
is
None
:
if
op_system
is
None
:
...
@@ -370,6 +371,8 @@ class CircleSeleniumMixin(SeleniumMixin):
...
@@ -370,6 +371,8 @@ class CircleSeleniumMixin(SeleniumMixin):
system_name
.
clear
()
system_name
.
clear
()
system_name
.
send_keys
(
op_system
)
system_name
.
send_keys
(
op_system
)
self
.
select_option
(
self
.
driver
.
find_element_by_id
(
self
.
select_option
(
self
.
driver
.
find_element_by_id
(
"id_datastore"
),
datastore
)
self
.
select_option
(
self
.
driver
.
find_element_by_id
(
"id_lease"
),
lease
)
"id_lease"
),
lease
)
self
.
select_option
(
self
.
driver
.
find_element_by_id
(
self
.
select_option
(
self
.
driver
.
find_element_by_id
(
"id_networks"
),
network
)
"id_networks"
),
network
)
...
...
circle/dashboard/tests/test_views.py
View file @
5f72d598
...
@@ -253,7 +253,8 @@ class VmDetailTest(LoginMixin, MockCeleryMixin, TestCase):
...
@@ -253,7 +253,8 @@ class VmDetailTest(LoginMixin, MockCeleryMixin, TestCase):
tmpl
.
set_level
(
self
.
u1
,
'owner'
)
tmpl
.
set_level
(
self
.
u1
,
'owner'
)
Vlan
.
objects
.
get
(
id
=
1
)
.
set_level
(
self
.
u1
,
'user'
)
Vlan
.
objects
.
get
(
id
=
1
)
.
set_level
(
self
.
u1
,
'user'
)
kwargs
=
tmpl
.
__dict__
.
copy
()
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
)
response
=
c
.
post
(
'/dashboard/template/1/'
,
kwargs
)
self
.
assertEqual
(
response
.
status_code
,
302
)
self
.
assertEqual
(
response
.
status_code
,
302
)
self
.
assertEqual
(
InstanceTemplate
.
objects
.
get
(
id
=
1
)
.
raw_data
,
self
.
assertEqual
(
InstanceTemplate
.
objects
.
get
(
id
=
1
)
.
raw_data
,
...
@@ -264,7 +265,7 @@ class VmDetailTest(LoginMixin, MockCeleryMixin, TestCase):
...
@@ -264,7 +265,7 @@ class VmDetailTest(LoginMixin, MockCeleryMixin, TestCase):
self
.
login
(
c
,
'superuser'
)
self
.
login
(
c
,
'superuser'
)
kwargs
=
InstanceTemplate
.
objects
.
get
(
id
=
1
)
.
__dict__
.
copy
()
kwargs
=
InstanceTemplate
.
objects
.
get
(
id
=
1
)
.
__dict__
.
copy
()
kwargs
.
update
(
name
=
't2'
,
lease
=
1
,
disks
=
1
,
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
)
response
=
c
.
post
(
'/dashboard/template/1/'
,
kwargs
)
self
.
assertEqual
(
response
.
status_code
,
302
)
self
.
assertEqual
(
response
.
status_code
,
302
)
self
.
assertEqual
(
InstanceTemplate
.
objects
.
get
(
id
=
1
)
.
raw_data
,
self
.
assertEqual
(
InstanceTemplate
.
objects
.
get
(
id
=
1
)
.
raw_data
,
...
...
requirements/base.txt
View file @
5f72d598
...
@@ -11,7 +11,7 @@ django-braces==1.8.0
...
@@ -11,7 +11,7 @@ django-braces==1.8.0
django-crispy-forms==1.6.0
django-crispy-forms==1.6.0
django-model-utils==2.2
django-model-utils==2.2
djangosaml2==0.13.0
djangosaml2==0.13.0
django-sizefield==0.
7
django-sizefield==0.
9.1
git+https://git.ik.bme.hu/circle/django-sshkey.git
git+https://git.ik.bme.hu/circle/django-sshkey.git
django-statici18n==1.1.3
django-statici18n==1.1.3
django-tables2==0.16.0
django-tables2==0.16.0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment