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
5f3e7e7b
authored
Dec 12, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix tests
parent
038f663e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
circle/dashboard/tests/test_views.py
+10
-7
No files found.
circle/dashboard/tests/test_views.py
View file @
5f3e7e7b
...
...
@@ -902,23 +902,26 @@ class GroupDeleteTest(LoginMixin, TestCase):
def
test_permitted_group_page
(
self
):
c
=
Client
()
self
.
login
(
c
,
'user0'
)
response
=
c
.
get
(
'/dashboard/group/delete/'
+
str
(
self
.
g1
.
pk
)
+
'/'
)
with
patch
(
'dashboard.views.util.messages'
)
as
msg
:
response
=
c
.
get
(
'/dashboard/group/delete/
%
d/'
%
self
.
g1
.
pk
)
assert
not
msg
.
error
.
called
and
not
msg
.
warning
.
called
self
.
assertEqual
(
response
.
status_code
,
200
)
def
test_unpermitted_group_page
(
self
):
c
=
Client
()
self
.
login
(
c
,
'user1'
)
groupnum
=
Group
.
objects
.
count
()
response
=
c
.
get
(
'/dashboard/group/delete/'
+
str
(
self
.
g1
.
pk
)
+
'/'
)
with
patch
(
'dashboard.views.util.messages'
)
as
msg
:
response
=
c
.
get
(
'/dashboard/group/delete/
%
d/'
%
self
.
g1
.
pk
)
assert
msg
.
error
.
called
or
msg
.
warning
.
called
self
.
assertEqual
(
response
.
status_code
,
302
)
self
.
assertEqual
(
Group
.
objects
.
count
(),
groupnum
)
def
test_anon_group_delete
(
self
):
c
=
Client
()
groupnum
=
Group
.
objects
.
count
()
response
=
c
.
post
(
'/dashboard/group/delete/'
+
str
(
self
.
g1
.
pk
)
+
'/'
)
response
=
c
.
get
(
'/dashboard/group/delete/
%
d/'
%
self
.
g1
.
pk
)
self
.
assertRedirects
(
response
,
'/accounts/login/?next=/dashboard/group/delete/5/'
,
status_code
=
302
)
self
.
assertEqual
(
response
.
status_code
,
302
)
self
.
assertEqual
(
Group
.
objects
.
count
(),
groupnum
)
def
test_unpermitted_group_delete
(
self
):
c
=
Client
()
...
...
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