Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3d1583e0
authored
May 08, 2015
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: fix tests
parent
dc8620ef
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
circle/circle/settings/base.py
+2
-0
circle/dashboard/fixtures/test-vm-fixture.json
+0
-0
circle/dashboard/tests/test_views.py
+8
-4
No files found.
circle/circle/settings/base.py
View file @
3d1583e0
...
@@ -562,3 +562,5 @@ ADMIN_ENABLED = False
...
@@ -562,3 +562,5 @@ ADMIN_ENABLED = False
BLACKLIST_PASSWORD
=
get_env_variable
(
"BLACKLIST_PASSWORD"
,
""
)
BLACKLIST_PASSWORD
=
get_env_variable
(
"BLACKLIST_PASSWORD"
,
""
)
BLACKLIST_HOOK_URL
=
get_env_variable
(
"BLACKLIST_HOOK_URL"
,
""
)
BLACKLIST_HOOK_URL
=
get_env_variable
(
"BLACKLIST_HOOK_URL"
,
""
)
REQUEST_HOOK_URL
=
get_env_variable
(
"REQUEST_HOOK_URL"
,
""
)
REQUEST_HOOK_URL
=
get_env_variable
(
"REQUEST_HOOK_URL"
,
""
)
SSHKEY_EMAIL_ADD_KEY
=
False
circle/dashboard/fixtures/test-vm-fixture.json
View file @
3d1583e0
This diff is collapsed.
Click to expand it.
circle/dashboard/tests/test_views.py
View file @
3d1583e0
...
@@ -1706,7 +1706,11 @@ class SshKeyTest(LoginMixin, TestCase):
...
@@ -1706,7 +1706,11 @@ class SshKeyTest(LoginMixin, TestCase):
self
.
u2
.
set_password
(
'password'
)
self
.
u2
.
set_password
(
'password'
)
self
.
u2
.
profile
=
Profile
()
self
.
u2
.
profile
=
Profile
()
self
.
u2
.
save
()
self
.
u2
.
save
()
self
.
k1
=
UserKey
(
key
=
'ssh-rsa AAAAB3NzaC1yc2EC asd'
,
user
=
self
.
u1
)
self
.
valid_key
=
(
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAYQDGqQy86fpVL3fAPE9ExTSvg4"
"Me7bpzH4azerTwWl8u9KKbhYe8XnC+cpvzbRxinFE9SqgQtKJzuxE0f/hHsNCQ"
"t3zDLHsqfFUdFQzkImXJ+duUKGyHKIsx6Os0j6nl+3c= asd"
)
self
.
k1
=
UserKey
(
key
=
self
.
valid_key
,
user
=
self
.
u1
)
self
.
k1
.
save
()
self
.
k1
.
save
()
def
tearDown
(
self
):
def
tearDown
(
self
):
...
@@ -1719,7 +1723,7 @@ class SshKeyTest(LoginMixin, TestCase):
...
@@ -1719,7 +1723,7 @@ class SshKeyTest(LoginMixin, TestCase):
self
.
login
(
c
,
self
.
u1
)
self
.
login
(
c
,
self
.
u1
)
resp
=
c
.
post
(
"/dashboard/sshkey/1/"
,
resp
=
c
.
post
(
"/dashboard/sshkey/1/"
,
{
'key'
:
'ssh-rsa AAAAB3NzaC1yc2EC'
})
{
'key'
:
self
.
valid_key
})
self
.
assertEqual
(
UserKey
.
objects
.
get
(
id
=
1
)
.
user
,
self
.
u1
)
self
.
assertEqual
(
UserKey
.
objects
.
get
(
id
=
1
)
.
user
,
self
.
u1
)
self
.
assertEqual
(
200
,
resp
.
status_code
)
self
.
assertEqual
(
200
,
resp
.
status_code
)
...
@@ -1728,7 +1732,7 @@ class SshKeyTest(LoginMixin, TestCase):
...
@@ -1728,7 +1732,7 @@ class SshKeyTest(LoginMixin, TestCase):
self
.
login
(
c
,
self
.
u2
)
self
.
login
(
c
,
self
.
u2
)
resp
=
c
.
post
(
"/dashboard/sshkey/1/"
,
resp
=
c
.
post
(
"/dashboard/sshkey/1/"
,
{
'key'
:
'ssh-rsa AAAAB3NzaC1yc2EC'
})
{
'key'
:
self
.
valid_key
})
self
.
assertEqual
(
UserKey
.
objects
.
get
(
id
=
1
)
.
user
,
self
.
u1
)
self
.
assertEqual
(
UserKey
.
objects
.
get
(
id
=
1
)
.
user
,
self
.
u1
)
self
.
assertEqual
(
403
,
resp
.
status_code
)
self
.
assertEqual
(
403
,
resp
.
status_code
)
...
@@ -1737,7 +1741,7 @@ class SshKeyTest(LoginMixin, TestCase):
...
@@ -1737,7 +1741,7 @@ class SshKeyTest(LoginMixin, TestCase):
self
.
login
(
c
,
self
.
u1
)
self
.
login
(
c
,
self
.
u1
)
resp
=
c
.
post
(
"/dashboard/sshkey/create/"
,
resp
=
c
.
post
(
"/dashboard/sshkey/create/"
,
{
'name'
:
'asd'
,
'key'
:
'ssh-rsa AAAAB3NzaC1yc2EC'
})
{
'name'
:
'asd'
,
'key'
:
self
.
valid_key
})
self
.
assertEqual
(
UserKey
.
objects
.
get
(
id
=
2
)
.
user
,
self
.
u1
)
self
.
assertEqual
(
UserKey
.
objects
.
get
(
id
=
2
)
.
user
,
self
.
u1
)
self
.
assertEqual
(
302
,
resp
.
status_code
)
self
.
assertEqual
(
302
,
resp
.
status_code
)
...
...
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