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

Cleaned up urls.py, tests for delete, mylinks, and registered

- fairly simple stuff here
parent c556c592
Pipeline #857 passed with stage
in 1 minute and 4 seconds
...@@ -63,3 +63,45 @@ class UrlsTest(TestCase): ...@@ -63,3 +63,45 @@ class UrlsTest(TestCase):
def test_signup(self): def test_signup(self):
url = reverse('signup') url = reverse('signup')
self.assertEqual(url, '/signup') self.assertEqual(url, '/signup')
"""
/myLinks - My-Links page, view and review links.
"""
def test_my_links(self):
url = reverse('my_links')
self.assertEqual(url, '/myLinks')
"""
/delete/<short> - Delete a link, no content display.
"""
def test_delete_chars(self):
url = reverse('delete', args=['dhaynes'])
self.assertEqual(url, '/delete/dhaynes')
"""
/delete/<short> - Delete a link, no content display.
"""
def test_delete_ints(self):
url = reverse('delete', args=['123456789'])
self.assertEqual(url, '/delete/123456789')
"""
/delete/<short> - Delete a link, no content display.
"""
def test_delete_chars_ints(self):
url = reverse('delete', args=['dhaynes123'])
self.assertEqual(url, '/delete/dhaynes123')
"""
/delete/<short> - Delete a link, no content display.
"""
def test_delete_full_slug(self):
url = reverse('delete', args=['dhaynes123_-'])
self.assertEqual(url, '/delete/dhaynes123_-')
"""
/registered - registration complete page
"""
def test_registered(self):
url = reverse('registered')
self.assertEqual(url, '/registered')
# Future Imports
from __future__ import unicode_literals, absolute_import, print_function, division
# Django Imports # Django Imports
from django.conf.urls import include, url from django.conf.urls import include, url
import django.contrib.auth.views import django.contrib.auth.views
...@@ -21,19 +24,21 @@ urlpatterns = [ ...@@ -21,19 +24,21 @@ urlpatterns = [
url(r'^view/(?P<short>[-\w]+)$', go.views.view, name='view'), url(r'^view/(?P<short>[-\w]+)$', go.views.view, name='view'),
# /about - About page. # /about - About page.
url(r'^about/?$', TemplateView.as_view(template_name='core/about.html'), name='about'), url(r'^about/?$', TemplateView.as_view(template_name='core/about.html'),
name='about'),
# /signup - Signup page for access. # /signup - Signup page for access.
url(r'^signup/?$', go.views.signup, name='signup'), url(r'^signup/?$', go.views.signup, name='signup'),
# /my - My-Links page, view and review links. # /myLinks - My-Links page, view and review links.
url(r'^myLinks/?$', go.views.my_links, name='my_links'), url(r'^myLinks/?$', go.views.my_links, name='my_links'),
# /delete/<short> - Delete a link, no content display. # /delete/<short> - Delete a link, no content display.
url(r'^delete/(?P<short>[-\w]+)$', go.views.delete, name='delete'), url(r'^delete/(?P<short>[-\w]+)$', go.views.delete, name='delete'),
# /registered - registration complete page # /registered - registration complete page
url(r'^registered/?$', TemplateView.as_view(template_name='registered.html'), name='registered'), url(r'^registered/?$', TemplateView.as_view(template_name='registered.html'),
name='registered'),
# /admin - Administrator interface. # /admin - Administrator interface.
url(r'^admin/?', admin.site.urls), url(r'^admin/?', admin.site.urls),
...@@ -46,7 +51,8 @@ urlpatterns = [ ...@@ -46,7 +51,8 @@ urlpatterns = [
if settings.AUTH_MODE.lower() == "ldap": if settings.AUTH_MODE.lower() == "ldap":
urlpatterns += [ urlpatterns += [
# Auth pages # Auth pages
url(r'^login$', django.contrib.auth.views.login, {'template_name' : 'core/login.html'}, name='go_login'), url(r'^login$', django.contrib.auth.views.login, {'template_name' : 'core/login.html'},
name='go_login'),
url(r'^logout$', django.contrib.auth.views.logout, {'next_page': '/'}, url(r'^logout$', django.contrib.auth.views.logout, {'next_page': '/'},
name='go_logout'), name='go_logout'),
] ]
......
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