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
b3690332
Commit
b3690332
authored
Jan 03, 2017
by
David Haynes
Browse files
Test if the auto registereduser creation function works
- our first real test!
parent
481b4a97
Pipeline
#728
passed with stage
in 56 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
go/go/test_models.py
View file @
b3690332
# Django Imports
from
django.test
import
TestCase
from
django.contrib.auth.models
import
User
# App Imports
from
go.models
import
URL
,
RegisteredUser
...
...
@@ -20,5 +21,10 @@ class URLTest(TestCase):
"""
class
RegisteredUserTest
(
TestCase
):
def
test_Django_Test
(
self
):
self
.
assertEqual
(
1
+
1
,
2
)
def
setUp
(
self
):
User
.
objects
.
create
(
username
=
'dhaynes'
,
password
=
'password'
)
def
test_RegisteredUserCreation
(
self
):
getUser
=
User
.
objects
.
get
(
username
=
'dhaynes'
)
getRegisteredUser
=
RegisteredUser
.
objects
.
get
(
user
=
getUser
)
self
.
assertTrue
(
getRegisteredUser
)
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