Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
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
7c53fbd9
authored
Apr 10, 2014
by
Oláh István Gergely
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: add more group creating tests - create group with post
parent
117bed4f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
circle/dashboard/tests/test_views.py
+31
-0
No files found.
circle/dashboard/tests/test_views.py
View file @
7c53fbd9
...
...
@@ -571,6 +571,37 @@ class GroupCreateTest(LoginMixin, TestCase):
response
=
c
.
get
(
'/dashboard/group/create/'
)
self
.
assertEqual
(
response
.
status_code
,
403
)
def
test_anon_group_create
(
self
):
c
=
Client
()
groupnum
=
Group
.
objects
.
count
()
response
=
c
.
post
(
'/dashboard/group/create/'
,
{
'name'
:
'newgroup'
})
self
.
assertEqual
(
response
.
status_code
,
302
)
self
.
assertEqual
(
Group
.
objects
.
count
(),
groupnum
)
def
test_unpermitted_group_create
(
self
):
c
=
Client
()
groupnum
=
Group
.
objects
.
count
()
self
.
login
(
c
,
'user1'
)
response
=
c
.
post
(
'/dashboard/group/create/'
,
{
'name'
:
'newgroup'
})
self
.
assertEqual
(
response
.
status_code
,
403
)
self
.
assertEqual
(
Group
.
objects
.
count
(),
groupnum
)
def
test_permitted_group_create
(
self
):
c
=
Client
()
groupnum
=
Group
.
objects
.
count
()
self
.
login
(
c
,
'user0'
)
response
=
c
.
post
(
'/dashboard/group/create/'
,
{
'name'
:
'newgroup'
})
self
.
assertEqual
(
response
.
status_code
,
302
)
self
.
assertEqual
(
Group
.
objects
.
count
(),
groupnum
+
1
)
def
test_superuser_group_create
(
self
):
c
=
Client
()
groupnum
=
Group
.
objects
.
count
()
self
.
login
(
c
,
'superuser'
)
response
=
c
.
post
(
'/dashboard/group/create/'
,
{
'name'
:
'newgroup'
})
self
.
assertEqual
(
response
.
status_code
,
302
)
self
.
assertEqual
(
Group
.
objects
.
count
(),
groupnum
+
1
)
class
GroupDetailTest
(
LoginMixin
,
TestCase
):
fixtures
=
[
'test-vm-fixture.json'
,
'node.json'
]
...
...
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