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
83bf10a7
authored
Jul 27, 2016
by
Dóbé Péter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: fix testing
parent
16bac875
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
circle/dashboard/tests/test_mockedviews.py
+4
-2
No files found.
circle/dashboard/tests/test_mockedviews.py
View file @
83bf10a7
...
@@ -52,7 +52,8 @@ class ViewUserTestCase(unittest.TestCase):
...
@@ -52,7 +52,8 @@ class ViewUserTestCase(unittest.TestCase):
def
test_not_superuser
(
self
):
def
test_not_superuser
(
self
):
request
=
FakeRequestFactory
(
superuser
=
False
)
request
=
FakeRequestFactory
(
superuser
=
False
)
with
patch
.
object
(
InstanceActivityDetail
,
'get_object'
)
as
go
:
with
patch
.
object
(
InstanceActivityDetail
,
'get_object'
)
as
go
:
go
.
return_value
=
MagicMock
(
spec
=
InstanceActivity
)
go
.
return_value
=
MagicMock
(
spec
=
InstanceActivity
,
activity_code
=
'test.test'
)
go
.
return_value
.
_meta
.
object_name
=
"InstanceActivity"
go
.
return_value
.
_meta
.
object_name
=
"InstanceActivity"
view
=
InstanceActivityDetail
.
as_view
()
view
=
InstanceActivityDetail
.
as_view
()
self
.
assertEquals
(
view
(
request
,
pk
=
1234
)
.
status_code
,
200
)
self
.
assertEquals
(
view
(
request
,
pk
=
1234
)
.
status_code
,
200
)
...
@@ -61,7 +62,8 @@ class ViewUserTestCase(unittest.TestCase):
...
@@ -61,7 +62,8 @@ class ViewUserTestCase(unittest.TestCase):
request
=
FakeRequestFactory
(
superuser
=
True
)
request
=
FakeRequestFactory
(
superuser
=
True
)
with
patch
.
object
(
InstanceActivityDetail
,
'get_object'
)
as
go
:
with
patch
.
object
(
InstanceActivityDetail
,
'get_object'
)
as
go
:
act
=
MagicMock
(
spec
=
InstanceActivity
)
act
=
MagicMock
(
spec
=
InstanceActivity
,
activity_code
=
'test.test'
)
act
.
_meta
.
object_name
=
"InstanceActivity"
act
.
_meta
.
object_name
=
"InstanceActivity"
act
.
user
.
pk
=
1
act
.
user
.
pk
=
1
go
.
return_value
=
act
go
.
return_value
=
act
...
...
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