Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
go
Commits
c6b66037
Unverified
Commit
c6b66037
authored
Mar 13, 2017
by
David Haynes
Browse files
Test the str() of the RegisteredUser model
- <Registered User: dhaynes - Approval Status: False>
parent
6d812372
Pipeline
#1072
passed with stage
in 1 minute and 1 second
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
go/go/test_models.py
View file @
c6b66037
...
...
@@ -11,28 +11,34 @@ from go.models import URL, RegisteredUser
"""
Test cases for the RegisteredUser Model
- check if RegisteredUsers are actually made
- check approval and registration status flipping
- check blocking
- check printing
- add in description
- check organization field
- check full name field
- check print(RegisteredUser)
"""
class
RegisteredUserTest
(
TestCase
):
def
setUp
(
self
):
User
.
objects
.
create
(
username
=
'dhaynes'
,
password
=
'password'
)
"""
check if RegisteredUsers are actually made
"""
def
test_RegisteredUserCreation
(
self
):
getUser
=
User
.
objects
.
get
(
username
=
'dhaynes'
)
getRegisteredUser
=
RegisteredUser
.
objects
.
get
(
user
=
getUser
)
self
.
assertTrue
(
getRegisteredUser
)
"""
- check printing
"""
def
test_checkPrint
(
self
):
# expected = '<Registered User: %s - Approval Status: %s>' % (self.user, self.approved)
self
.
assertTrue
(
True
)
getUser
=
User
.
objects
.
get
(
username
=
'dhaynes'
)
getRegisteredUser
=
RegisteredUser
.
objects
.
get
(
user
=
getUser
)
expected
=
'<Registered User: dhaynes - Approval Status: False>'
actual
=
str
(
getRegisteredUser
)
self
.
assertEqual
(
expected
,
actual
)
"""
Test cases for the URL Model
...
...
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