test_urls.py 5.63 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# """
# settings/test_urls.py

# Test that all the URLs route properly.

# References:
#     - https://stackoverflow.com/questions/18987051/how-do-i-unit-test-django-urls
# """
# # Django Imports
# from django.test import TestCase
# from django.urls import reverse

# class UrlsTest(TestCase):
#     def test_index_reverse(self):
#         """
#         / - Homepage url.
#         """
#         url = reverse('index')
#         self.assertEqual(url, '/')

#     def test_view_reverse_chars(self):
#         """
#         /view/<short> - View URL data.
#         """
#         url = reverse('view', args=['dhaynes'])
#         self.assertEqual(url, '/view/dhaynes')

#     def test_view_reverse_ints(self):
#         """
#         /view/<short> - View URL data.
#         """
#         url = reverse('view', args=['123456789'])
#         self.assertEqual(url, '/view/123456789')

#     def test_view_reverse_chars_ints(self):
#         """
#         /view/<short> - View URL data.
#         """
#         url = reverse('view', args=['dhaynes123'])
#         self.assertEqual(url, '/view/dhaynes123')

#     def test_view_reverse_full_slug(self):
#         """
#         /view/<short> - View URL data.
#         """
#         url = reverse('view', args=['dhaynes123_-'])
#         self.assertEqual(url, '/view/dhaynes123_-')

#     def test_about_reverse(self):
#         """
#         /about - About page.
#         """
#         url = reverse('about')
#         self.assertEqual(url, '/about')

#     def test_signup_reverse(self):
#         """
#         /signup - Signup page for access.
#         """
#         url = reverse('signup')
#         self.assertEqual(url, '/signup')

#     def test_new(self):
#         """
#         /new - Create a new Go Link
#         """
#         url = reverse("new_link")
#         self.assertEqual(url, '/new')

#     def test_my_links_reverse(self):
#         """
#         /my - My-Links page, view and review links.
#         """
#         url = reverse('my_links')
#         self.assertEqual(url, '/my')

#     def test_edit_reverse_chars(self):
#         """
#         /edit/<short> - Delete a link, no content display.
#         """
#         url = reverse('edit', args=['dhaynes'])
#         self.assertEqual(url, '/edit/dhaynes')

#     def test_edit_reverse_ints(self):
#         """
#         /edit/<short> - Delete a link, no content display.
#         """
#         url = reverse('edit', args=['123456789'])
#         self.assertEqual(url, '/edit/123456789')

#     def test_edit_reverse_chars_ints(self):
#         """
#         /edit/<short> - Delete a link, no content display.
#         """
#         url = reverse('edit', args=['dhaynes123'])
#         self.assertEqual(url, '/edit/dhaynes123')

#     def test_edit_reverse_full_slug(self):
#         """
#         /edit/<short> - Delete a link, no content display.
#         """
#         url = reverse('edit', args=['dhaynes123_-'])
#         self.assertEqual(url, '/edit/dhaynes123_-')

#     def test_delete_reverse_chars(self):
#         """
#         /delete/<short> - Delete a link, no content display.
#         """
#         url = reverse('delete', args=['dhaynes'])
#         self.assertEqual(url, '/delete/dhaynes')

#     def test_delete_reverse_ints(self):
#         """
#         /delete/<short> - Delete a link, no content display.
#         """
#         url = reverse('delete', args=['123456789'])
#         self.assertEqual(url, '/delete/123456789')

#     def test_delete_reverse_chars_ints(self):
#         """
#         /delete/<short> - Delete a link, no content display.
#         """
#         url = reverse('delete', args=['dhaynes123'])
#         self.assertEqual(url, '/delete/dhaynes123')

#     def test_delete_reverse_full_slug(self):
#         """
#         /delete/<short> - Delete a link, no content display.
#         """
#         url = reverse('delete', args=['dhaynes123_-'])
#         self.assertEqual(url, '/delete/dhaynes123_-')

#     def test_registered_reverse(self):
#         """
#         /registered - registration complete page
#         """
#         url = reverse('registered')
#         self.assertEqual(url, '/registered')

#     # The /admin URL is not tested as it is never resolves in source and
#     # generally Django yells at you if the admin page breaks

#     def test_useradmin(self):
#         """
#         /manage - user approval interface
#         """
#         url = reverse('useradmin')
#         self.assertEqual(url, '/manage')

#     def test_login(self):
#         """
#         /login - login portal
#         """
#         url = reverse('go_login')
#         self.assertEqual(url, '/login')

#     def test_logout(self):
#         """
#         /logout - logout portal
#         """
#         url = reverse('go_logout')
#         self.assertEqual(url, '/logout')

#     # def test_delete_chars(self):
#     #     """
#     #     /<short> - Redirect to a go link.
#     #     """
#     #     url = reverse('redirection', args=['dhaynes'])
#     #     self.assertEqual(url, '/dhaynes')

#     # def test_delete_ints(self):
#     #     """
#     #     /<short> - Redirect to a go link.
#     #     """
#     #     url = reverse('redirection', args=['123456789'])
#     #     self.assertEqual(url, '/123456789')

#     # def test_delete_chars_ints(self):
#     #     """
#     #     /<short> - Redirect to a go link.
#     #     """
#     #     url = reverse('redirection', args=['dhaynes123'])
#     #     self.assertEqual(url, '/dhaynes123')

#     # def test_delete_full_slug(self):
#     #     """
#     #     /<short> - Redirect to a go link.
#     #     """
#     #     url = reverse('redirection', args=['dhaynes123_-'])
#     #     self.assertEqual(url, '/dhaynes123_-') TODO