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

Test all the clicks fields

- can they all increment?
parent 473c34fd
Pipeline #1089 passed with stage
in 58 seconds
......@@ -393,14 +393,58 @@ class URLTest(TestCase):
current_url.save()
except DataError as ex:
self.assertTrue(ex)
# clicks -------------------------------------------------------------------
def test_clicks(self):
"""
Test that clicks incremention works
"""
# 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)
# Increment
current_url.clicks += 1;
self.assertEqual(current_url.clicks, 1)
# qrclicks -----------------------------------------------------------------
def test_qrclicks(self):
"""
Test that cliqrclickscks incremention works
"""
# 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)
# Increment
current_url.qrclicks += 1;
self.assertEqual(current_url.qrclicks, 1)
# socialclicks -------------------------------------------------------------
def test_socialclicks(self):
"""
Test that socialclicks incremention works
"""
# 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)
# Increment
current_url.socialclicks += 1;
self.assertEqual(current_url.socialclicks, 1)
# expires ------------------------------------------------------------------
# __str__ ------------------------------------------------------------------
......
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