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
215cca20
Unverified
Commit
215cca20
authored
Mar 13, 2017
by
David Haynes
Browse files
Add sanity check for expires field
parent
b5f775d9
Pipeline
#1091
passed with stage
in 55 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
go/go/test_models.py
View file @
215cca20
...
...
@@ -450,6 +450,25 @@ class URLTest(TestCase):
# expires ------------------------------------------------------------------
def
test_expires
(
self
):
"""
Test that the expires field functions as intended
"""
tomorrow
=
timezone
.
now
()
+
timezone
.
timedelta
(
days
=
1
)
# Get the URL to apply it to
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
)
# Apply the date
current_url
.
date_created
=
tomorrow
current_url
.
save
()
self
.
assertEqual
(
current_url
.
date_created
,
tomorrow
)
# __str__ ------------------------------------------------------------------
def
test_check_str
(
self
):
...
...
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