Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
rpteam
Revue de Press
Commits
8616f16a
Commit
8616f16a
authored
Apr 18, 2019
by
Okhin
Browse files
Adding rthe few missing tests for UserProfile
parent
4a33912e
Changes
1
Hide whitespace changes
Inline
Side-by-side
apps/userprofile/tests.py
deleted
100644 → 0
View file @
4a33912e
from
django.contrib.auth.models
import
User
from
django.template.defaultfilters
import
slugify
from
userprofile.apps
import
UserprofileConfig
from
userprofile.models
import
Profile
from
userprofile.factories
import
ProfileFactory
def
test_init
():
assert
UserprofileConfig
.
name
==
"userprofile"
def
test_profile
():
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
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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