Unverified Commit b5f775d9 authored by David Haynes's avatar David Haynes
Browse files

Check __str__ of URL model

- also remove some semicolons lol
parent bba7e210
Pipeline #1090 passed with stage
in 1 minute
......@@ -407,7 +407,8 @@ class URLTest(TestCase):
current_url = URL.objects.get(owner=get_registered_user)
# Increment
current_url.clicks += 1;
current_url.clicks += 1
current_url.save()
self.assertEqual(current_url.clicks, 1)
......@@ -424,7 +425,8 @@ class URLTest(TestCase):
current_url = URL.objects.get(owner=get_registered_user)
# Increment
current_url.qrclicks += 1;
current_url.qrclicks += 1
current_url.save()
self.assertEqual(current_url.qrclicks, 1)
......@@ -441,7 +443,8 @@ class URLTest(TestCase):
current_url = URL.objects.get(owner=get_registered_user)
# Increment
current_url.socialclicks += 1;
current_url.socialclicks += 1
current_url.save()
self.assertEqual(current_url.socialclicks, 1)
......@@ -449,4 +452,21 @@ class URLTest(TestCase):
# __str__ ------------------------------------------------------------------
def test_check_str(self):
"""
check printing
"""
# Get the URL to test
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.target = "https://dhaynes.xyz"
current_url.save()
expected = '<Owner: dhaynes - Target URL: https://dhaynes.xyz>'
actual = str(current_url)
self.assertEqual(expected, actual)
# generate_valid_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