Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
5432a550
authored
Jul 18, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: fix mocked tests
parent
8ef3f54f
Show 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 @
5432a550
...
@@ -436,7 +436,8 @@ def FakeRequestFactory(user=None, **kwargs):
...
@@ -436,7 +436,8 @@ def FakeRequestFactory(user=None, **kwargs):
if
user
is
None
:
if
user
is
None
:
user
=
UserFactory
()
user
=
UserFactory
()
user
.
is_authenticated
=
lambda
:
kwargs
.
pop
(
'authenticated'
,
True
)
auth
=
kwargs
.
pop
(
'authenticated'
,
True
)
user
.
is_authenticated
=
lambda
:
auth
user
.
is_superuser
=
kwargs
.
pop
(
'superuser'
,
False
)
user
.
is_superuser
=
kwargs
.
pop
(
'superuser'
,
False
)
if
kwargs
.
pop
(
'has_perms_mock'
,
False
):
if
kwargs
.
pop
(
'has_perms_mock'
,
False
):
user
.
has_perms
=
MagicMock
(
return_value
=
True
)
user
.
has_perms
=
MagicMock
(
return_value
=
True
)
...
@@ -455,7 +456,8 @@ def FakeRequestFactory(user=None, **kwargs):
...
@@ -455,7 +456,8 @@ def FakeRequestFactory(user=None, **kwargs):
request
.
GET
.
update
(
kwargs
.
pop
(
'GET'
,
{}))
request
.
GET
.
update
(
kwargs
.
pop
(
'GET'
,
{}))
if
len
(
kwargs
):
if
len
(
kwargs
):
warnings
.
warn
(
"FakeRequestFactory kwargs unused: "
+
unicode
(
kwargs
))
warnings
.
warn
(
"FakeRequestFactory kwargs unused: "
+
unicode
(
kwargs
),
stacklevel
=
2
)
return
request
return
request
...
...
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