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
68518b7a
Unverified
Commit
68518b7a
authored
Mar 13, 2017
by
David Haynes
Browse files
Test the date_created field
- does it accept the date format?
parent
6581e0ce
Pipeline
#1086
passed with stage
in 55 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
go/go/test_models.py
View file @
68518b7a
...
...
@@ -5,6 +5,8 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
from
django.test
import
TestCase
from
django.contrib.auth.models
import
User
from
django.db.utils
import
DataError
from
django.utils
import
timezone
# App Imports
from
go.models
import
URL
,
RegisteredUser
...
...
@@ -262,6 +264,22 @@ class URLTest(TestCase):
# date_created -------------------------------------------------------------
def
test_date_created
(
self
):
"""
Test that the timedate is set properly on URL creation
"""
now
=
timezone
.
now
get_user
=
User
.
objects
.
get
(
username
=
'dhaynes'
)
get_registered_user
=
RegisteredUser
.
objects
.
get
(
user
=
get_user
)
current_url
=
URL
.
objects
.
get
(
owner
=
get_registered_user
)
current_url
.
date_created
=
now
self
.
assertEqual
(
current_url
.
date_created
,
now
)
# target -------------------------------------------------------------------
# short --------------------------------------------------------------------
...
...
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