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
832cfdce
authored
Sep 09, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: fix tests
parent
04305fa9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
circle/dashboard/tests/test_views.py
+10
-10
No files found.
circle/dashboard/tests/test_views.py
View file @
832cfdce
...
@@ -1134,7 +1134,7 @@ class GroupDetailTest(LoginMixin, TestCase):
...
@@ -1134,7 +1134,7 @@ class GroupDetailTest(LoginMixin, TestCase):
c
=
Client
()
c
=
Client
()
user_in_group
=
self
.
g1
.
user_set
.
count
()
user_in_group
=
self
.
g1
.
user_set
.
count
()
response
=
c
.
post
(
'/dashboard/group/'
+
response
=
c
.
post
(
'/dashboard/group/'
+
str
(
self
.
g1
.
pk
)
+
'/'
,
{
'
list-new-name
'
:
'user3'
})
str
(
self
.
g1
.
pk
)
+
'/'
,
{
'
new_member
'
:
'user3'
})
self
.
assertEqual
(
user_in_group
,
self
.
assertEqual
(
user_in_group
,
self
.
g1
.
user_set
.
count
())
self
.
g1
.
user_set
.
count
())
self
.
assertEqual
(
response
.
status_code
,
302
)
self
.
assertEqual
(
response
.
status_code
,
302
)
...
@@ -1144,7 +1144,7 @@ class GroupDetailTest(LoginMixin, TestCase):
...
@@ -1144,7 +1144,7 @@ class GroupDetailTest(LoginMixin, TestCase):
self
.
login
(
c
,
'user3'
)
self
.
login
(
c
,
'user3'
)
user_in_group
=
self
.
g1
.
user_set
.
count
()
user_in_group
=
self
.
g1
.
user_set
.
count
()
response
=
c
.
post
(
'/dashboard/group/'
+
response
=
c
.
post
(
'/dashboard/group/'
+
str
(
self
.
g1
.
pk
)
+
'/'
,
{
'
list-new-name
'
:
'user3'
})
str
(
self
.
g1
.
pk
)
+
'/'
,
{
'
new_member
'
:
'user3'
})
self
.
assertEqual
(
user_in_group
,
self
.
g1
.
user_set
.
count
())
self
.
assertEqual
(
user_in_group
,
self
.
g1
.
user_set
.
count
())
self
.
assertEqual
(
response
.
status_code
,
403
)
self
.
assertEqual
(
response
.
status_code
,
403
)
...
@@ -1153,7 +1153,7 @@ class GroupDetailTest(LoginMixin, TestCase):
...
@@ -1153,7 +1153,7 @@ class GroupDetailTest(LoginMixin, TestCase):
self
.
login
(
c
,
'superuser'
)
self
.
login
(
c
,
'superuser'
)
user_in_group
=
self
.
g1
.
user_set
.
count
()
user_in_group
=
self
.
g1
.
user_set
.
count
()
response
=
c
.
post
(
'/dashboard/group/'
+
response
=
c
.
post
(
'/dashboard/group/'
+
str
(
self
.
g1
.
pk
)
+
'/'
,
{
'
list-new-name
'
:
'user3'
})
str
(
self
.
g1
.
pk
)
+
'/'
,
{
'
new_member
'
:
'user3'
})
self
.
assertEqual
(
user_in_group
+
1
,
self
.
g1
.
user_set
.
count
())
self
.
assertEqual
(
user_in_group
+
1
,
self
.
g1
.
user_set
.
count
())
self
.
assertEqual
(
response
.
status_code
,
302
)
self
.
assertEqual
(
response
.
status_code
,
302
)
...
@@ -1162,7 +1162,7 @@ class GroupDetailTest(LoginMixin, TestCase):
...
@@ -1162,7 +1162,7 @@ class GroupDetailTest(LoginMixin, TestCase):
self
.
login
(
c
,
'user0'
)
self
.
login
(
c
,
'user0'
)
user_in_group
=
self
.
g1
.
user_set
.
count
()
user_in_group
=
self
.
g1
.
user_set
.
count
()
response
=
c
.
post
(
'/dashboard/group/'
+
response
=
c
.
post
(
'/dashboard/group/'
+
str
(
self
.
g1
.
pk
)
+
'/'
,
{
'
list-new-name
'
:
'user3'
})
str
(
self
.
g1
.
pk
)
+
'/'
,
{
'
new_member
'
:
'user3'
})
self
.
assertEqual
(
user_in_group
+
1
,
self
.
g1
.
user_set
.
count
())
self
.
assertEqual
(
user_in_group
+
1
,
self
.
g1
.
user_set
.
count
())
self
.
assertEqual
(
response
.
status_code
,
302
)
self
.
assertEqual
(
response
.
status_code
,
302
)
...
@@ -1172,7 +1172,7 @@ class GroupDetailTest(LoginMixin, TestCase):
...
@@ -1172,7 +1172,7 @@ class GroupDetailTest(LoginMixin, TestCase):
user_in_group
=
self
.
g1
.
user_set
.
count
()
user_in_group
=
self
.
g1
.
user_set
.
count
()
response
=
c
.
post
(
'/dashboard/group/'
+
response
=
c
.
post
(
'/dashboard/group/'
+
str
(
self
.
g1
.
pk
)
+
'/'
,
str
(
self
.
g1
.
pk
)
+
'/'
,
{
'
list-new-namelist
'
:
'user1
\r\n
user2'
})
{
'
new_members
'
:
'user1
\r\n
user2'
})
self
.
assertEqual
(
user_in_group
+
2
,
self
.
g1
.
user_set
.
count
())
self
.
assertEqual
(
user_in_group
+
2
,
self
.
g1
.
user_set
.
count
())
self
.
assertEqual
(
response
.
status_code
,
302
)
self
.
assertEqual
(
response
.
status_code
,
302
)
...
@@ -1182,7 +1182,7 @@ class GroupDetailTest(LoginMixin, TestCase):
...
@@ -1182,7 +1182,7 @@ class GroupDetailTest(LoginMixin, TestCase):
user_in_group
=
self
.
g1
.
user_set
.
count
()
user_in_group
=
self
.
g1
.
user_set
.
count
()
response
=
c
.
post
(
'/dashboard/group/'
+
response
=
c
.
post
(
'/dashboard/group/'
+
str
(
self
.
g1
.
pk
)
+
'/'
,
str
(
self
.
g1
.
pk
)
+
'/'
,
{
'
list-new-namelist
'
:
'user1
\r\n
noname
\r\n
user2'
})
{
'
new_members
'
:
'user1
\r\n
noname
\r\n
user2'
})
self
.
assertEqual
(
user_in_group
+
2
,
self
.
g1
.
user_set
.
count
())
self
.
assertEqual
(
user_in_group
+
2
,
self
.
g1
.
user_set
.
count
())
self
.
assertEqual
(
response
.
status_code
,
302
)
self
.
assertEqual
(
response
.
status_code
,
302
)
...
@@ -1192,7 +1192,7 @@ class GroupDetailTest(LoginMixin, TestCase):
...
@@ -1192,7 +1192,7 @@ class GroupDetailTest(LoginMixin, TestCase):
user_in_group
=
self
.
g1
.
user_set
.
count
()
user_in_group
=
self
.
g1
.
user_set
.
count
()
response
=
c
.
post
(
'/dashboard/group/'
+
response
=
c
.
post
(
'/dashboard/group/'
+
str
(
self
.
g1
.
pk
)
+
'/'
,
str
(
self
.
g1
.
pk
)
+
'/'
,
{
'
list-new-namelist
'
:
'user1
\r\n
user2'
})
{
'
new_members
'
:
'user1
\r\n
user2'
})
self
.
assertEqual
(
user_in_group
,
self
.
g1
.
user_set
.
count
())
self
.
assertEqual
(
user_in_group
,
self
.
g1
.
user_set
.
count
())
self
.
assertEqual
(
response
.
status_code
,
403
)
self
.
assertEqual
(
response
.
status_code
,
403
)
...
@@ -1201,7 +1201,7 @@ class GroupDetailTest(LoginMixin, TestCase):
...
@@ -1201,7 +1201,7 @@ class GroupDetailTest(LoginMixin, TestCase):
user_in_group
=
self
.
g1
.
user_set
.
count
()
user_in_group
=
self
.
g1
.
user_set
.
count
()
response
=
c
.
post
(
'/dashboard/group/'
+
response
=
c
.
post
(
'/dashboard/group/'
+
str
(
self
.
g1
.
pk
)
+
'/'
,
str
(
self
.
g1
.
pk
)
+
'/'
,
{
'
list-new-namelist
'
:
'user1
\r\n
user2'
})
{
'
new_members
'
:
'user1
\r\n
user2'
})
self
.
assertEqual
(
user_in_group
,
self
.
g1
.
user_set
.
count
())
self
.
assertEqual
(
user_in_group
,
self
.
g1
.
user_set
.
count
())
self
.
assertEqual
(
response
.
status_code
,
302
)
self
.
assertEqual
(
response
.
status_code
,
302
)
...
@@ -1471,8 +1471,8 @@ class TransferOwnershipViewTest(LoginMixin, TestCase):
...
@@ -1471,8 +1471,8 @@ class TransferOwnershipViewTest(LoginMixin, TestCase):
c2
=
self
.
u2
.
notification_set
.
count
()
c2
=
self
.
u2
.
notification_set
.
count
()
c
=
Client
()
c
=
Client
()
self
.
login
(
c
,
'user2'
)
self
.
login
(
c
,
'user2'
)
response
=
c
.
post
(
'/dashboard/vm/1/tx/'
)
response
=
c
.
post
(
'/dashboard/vm/1/tx/'
,
{
'name'
:
'userx'
}
)
assert
response
.
status_code
==
40
0
assert
response
.
status_code
==
40
3
self
.
assertEqual
(
self
.
u2
.
notification_set
.
count
(),
c2
)
self
.
assertEqual
(
self
.
u2
.
notification_set
.
count
(),
c2
)
def
test_owned_offer
(
self
):
def
test_owned_offer
(
self
):
...
...
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