Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
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
20dd2231
authored
Jan 21, 2015
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: fix tests
parent
8d1803e4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
circle/dashboard/tests/test_views.py
+9
-6
No files found.
circle/dashboard/tests/test_views.py
View file @
20dd2231
...
@@ -1293,24 +1293,26 @@ class GroupDetailTest(LoginMixin, TestCase):
...
@@ -1293,24 +1293,26 @@ class GroupDetailTest(LoginMixin, TestCase):
self
.
login
(
c
,
'user1'
)
self
.
login
(
c
,
'user1'
)
self
.
u1
.
user_permissions
.
add
(
Permission
.
objects
.
get
(
self
.
u1
.
user_permissions
.
add
(
Permission
.
objects
.
get
(
name
=
'Can add user'
))
name
=
'Can add user'
))
response
=
c
.
post
(
'/dashboard/
group/
%
d/create/'
%
self
.
g1
.
pk
,
response
=
c
.
post
(
'/dashboard/
profile/create/'
,
{
'username'
:
'userx1'
,
{
'username'
:
'userx1'
,
'groups'
:
self
.
g1
.
pk
,
'password1'
:
'test123'
,
'password1'
:
'test123'
,
'password2'
:
'test123'
})
'password2'
:
'test123'
})
self
.
assertEqual
(
response
.
status_code
,
403
)
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertEqual
(
user_count
,
self
.
g1
.
user_set
.
count
())
self
.
assertEqual
(
user_count
,
self
.
g1
.
user_set
.
count
())
def
test_permitted_user_add_wo_can_add_user_perm
(
self
):
def
test_permitted_user_add_wo_can_add_user_perm
(
self
):
user_count
=
self
.
g1
.
user_set
.
count
()
user_count
=
self
.
g1
.
user_set
.
count
()
c
=
Client
()
c
=
Client
()
self
.
login
(
c
,
'user0'
)
self
.
login
(
c
,
'user0'
)
response
=
c
.
post
(
'/dashboard/
group/
%
d/create/'
%
self
.
g1
.
pk
,
response
=
c
.
post
(
'/dashboard/
profile/create/'
,
{
'username'
:
'userx2'
,
{
'username'
:
'userx2'
,
'groups'
:
self
.
g1
.
pk
,
'password1'
:
'test123'
,
'password1'
:
'test123'
,
'password2'
:
'test123'
})
'password2'
:
'test123'
})
self
.
assertRedirects
(
self
.
assertRedirects
(
response
,
response
,
'/accounts/login/?next=/dashboard/
group/
%
d/create/'
%
self
.
g1
.
pk
)
'/accounts/login/?next=/dashboard/
profile/create/'
)
self
.
assertEqual
(
response
.
status_code
,
302
)
self
.
assertEqual
(
response
.
status_code
,
302
)
self
.
assertEqual
(
user_count
,
self
.
g1
.
user_set
.
count
())
self
.
assertEqual
(
user_count
,
self
.
g1
.
user_set
.
count
())
...
@@ -1320,11 +1322,12 @@ class GroupDetailTest(LoginMixin, TestCase):
...
@@ -1320,11 +1322,12 @@ class GroupDetailTest(LoginMixin, TestCase):
name
=
'Can add user'
))
name
=
'Can add user'
))
c
=
Client
()
c
=
Client
()
self
.
login
(
c
,
'user0'
)
self
.
login
(
c
,
'user0'
)
response
=
c
.
post
(
'/dashboard/
group/
%
d/create/'
%
self
.
g1
.
pk
,
response
=
c
.
post
(
'/dashboard/
profile/create/'
,
{
'username'
:
'userx2'
,
{
'username'
:
'userx2'
,
'groups'
:
self
.
g1
.
pk
,
'password1'
:
'test123'
,
'password1'
:
'test123'
,
'password2'
:
'test123'
})
'password2'
:
'test123'
})
self
.
assertRedirects
(
response
,
'/dashboard/
group/
%
d/'
%
self
.
g1
.
pk
)
self
.
assertRedirects
(
response
,
'/dashboard/
profile/userx2/'
)
self
.
assertEqual
(
user_count
+
1
,
self
.
g1
.
user_set
.
count
())
self
.
assertEqual
(
user_count
+
1
,
self
.
g1
.
user_set
.
count
())
self
.
assertEqual
(
response
.
status_code
,
302
)
self
.
assertEqual
(
response
.
status_code
,
302
)
...
...
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