Unverified Commit 68518b7a authored by David Haynes's avatar 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
......@@ -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 --------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment