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

Test the full slug capabilites of /view URL

- chars, ints, _ and -'s
parent b443e945
Pipeline #854 passed with stage
in 1 minute and 25 seconds
......@@ -22,11 +22,34 @@ class UrlsTest(TestCase):
url = reverse('index')
self.assertEqual(url, '/')
"""
# /view/<short> - View URL data.
url(r'^view/(?P<short>[-\w]+)$', go.views.view, name='view'),
"""
def test_view(self):
def test_view_chars(self):
url = reverse('view', args=['dhaynes'])
self.assertEqual(url, '/view/dhaynes')
"""
# /view/<short> - View URL data.
url(r'^view/(?P<short>[-\w]+)$', go.views.view, name='view'),
"""
def test_view_ints(self):
url = reverse('view', args=['123456789'])
self.assertEqual(url, '/view/123456789')
"""
# /view/<short> - View URL data.
url(r'^view/(?P<short>[-\w]+)$', go.views.view, name='view'),
"""
def test_view_chars_ints(self):
url = reverse('view', args=['dhaynes123'])
self.assertEqual(url, '/view/dhaynes123')
"""
# /view/<short> - View URL data.
url(r'^view/(?P<short>[-\w]+)$', go.views.view, name='view'),
"""
def test_view_full_slug(self):
url = reverse('view', args=['dhaynes123_-'])
self.assertEqual(url, '/view/dhaynes123_-')
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