Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
15
Issues
15
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
La Quadrature du Net
rpteam
rp
Commits
4a33912e
Commit
4a33912e
authored
Apr 18, 2019
by
Okhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let's actually run the tests
parent
6ad22830
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
apps/userprofile/tests/__init__.py
apps/userprofile/tests/__init__.py
+0
-0
apps/userprofile/tests/test_userprofile.py
apps/userprofile/tests/test_userprofile.py
+35
-0
No files found.
apps/userprofile/tests/__init__.py
0 → 100644
View file @
4a33912e
apps/userprofile/tests/test_userprofile.py
0 → 100644
View file @
4a33912e
from
django.contrib.auth.models
import
User
,
Permission
from
django.template.defaultfilters
import
slugify
from
django.test
import
Client
,
TestCase
from
userprofile.apps
import
UserprofileConfig
from
userprofile.models
import
Profile
from
userprofile.factories
import
ProfileFactory
class
ProfileTestCase
(
TestCase
):
def
setUp
(
self
):
self
.
client
=
Client
()
p
=
Permission
.
objects
.
get
(
codename
=
'can_edit_users'
)
user
=
User
.
objects
.
create_user
(
'test'
,
'test@example.org'
,
'test'
)
user
.
user_permissions
.
add
(
p
)
self
.
user
=
user
def
test_init
(
self
):
assert
UserprofileConfig
.
name
==
"userprofile"
def
test_profile
(
self
):
profile
=
ProfileFactory
()
assert
type
(
profile
.
user
)
==
User
assert
type
(
profile
)
==
Profile
assert
profile
.
slug
==
slugify
(
profile
.
user
.
username
)
assert
str
(
profile
)
==
profile
.
user
.
username
profile
.
delete
()
def
test_list
(
self
):
self
.
client
.
force_login
(
self
.
user
)
r
=
self
.
client
.
get
(
'/users/list/'
)
assert
r
.
status_code
==
200
assert
self
.
user
.
email
in
str
(
r
.
content
)
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