Unverified Commit 215cca20 authored by David Haynes's avatar David Haynes
Browse files

Add sanity check for expires field

parent b5f775d9
Pipeline #1091 passed with stage
in 55 seconds
......@@ -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):
......
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