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

Uncomment out the critical section

- I'm not sure how I feel about this relationship gitlab-ci, do things
  need to be so aggressive
parent 84fd497c
Pipeline #1154 failed with stage
in 1 minute and 9 seconds
# """ """
# go/test_views.py go/test_views.py
# References: References:
# - http://stackoverflow.com/a/11887308 - http://stackoverflow.com/a/11887308
# """ """
# # Future Imports # Future Imports
# from __future__ import (absolute_import, division, print_function, from __future__ import (absolute_import, division, print_function,
# unicode_literals) unicode_literals)
# # Django Imports # Django Imports
# from django.test import TestCase, Client from django.test import TestCase, Client
# from django.contrib.auth.models import User from django.contrib.auth.models import User
# # App Imports # App Imports
# from go.models import URL, RegisteredUser from go.models import URL, RegisteredUser
# class IndexTest(TestCase): class IndexTest(TestCase):
# """ """
# Test cases for the index view Test cases for the index view
# """ """
# def test_index_get_anon(self): def test_index_get_anon(self):
# """ """
# Test that the index view loads (200 OK) for anons Test that the index view loads (200 OK) for anons
# """ """
# response = self.client.get('/') response = self.client.get('/')
# self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
# def test_index_get_auth(self): def test_index_get_auth(self):
# """ """
# Test that the index view loads (200 OK) for authed users Test that the index view loads (200 OK) for authed users
# """ """
# client = Client() client = Client()
# client.login(username='dhaynes', password='password') client.login(username='dhaynes', password='password')
# response = client.get('/') response = client.get('/')
# self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
# class NewLinkTest(TestCase): class NewLinkTest(TestCase):
# """ """
# Test cases for the new_link view Test cases for the new_link view
# """ """
# def test_new_link_get_anon(self): def test_new_link_get_anon(self):
# """ """
# Test that the index view redirects anons to login with cas on an EXTERNAL Test that the index view redirects anons to login with cas on an EXTERNAL
# CAS link, so 302 REDIRECT. CAS link, so 302 REDIRECT.
# """ """
# response = self.client.get('/newLink') response = self.client.get('/newLink')
# self.assertEqual(response.status_code, 302) self.assertEqual(response.status_code, 302)
# class MyLinksTest(TestCase): class MyLinksTest(TestCase):
# """ """
# Test cases for the my_links view Test cases for the my_links view
# """ """
# def test_new_link_get_anon(self): def test_new_link_get_anon(self):
# """ """
# Test that the index view redirects anons to login with cas on an EXTERNAL Test that the index view redirects anons to login with cas on an EXTERNAL
# CAS link, so 302 REDIRECT. CAS link, so 302 REDIRECT.
# """ """
# response = self.client.get('/myLinks') response = self.client.get('/myLinks')
# self.assertEqual(response.status_code, 302) self.assertEqual(response.status_code, 302)
# class PostTest(TestCase): class PostTest(TestCase):
# """ """
# Test cases for the post() helper function Test cases for the post() helper function
# """ """
# def test_django_test(self): def test_django_test(self):
# """ """
# Default test case, does not actually test anything Default test case, does not actually test anything
# """ """
# self.assertEqual("Hello World!", "Hello World!") self.assertEqual("Hello World!", "Hello World!")
# class ViewTest(TestCase): class ViewTest(TestCase):
# """ """
# Test cases for the "view" view Test cases for the "view" view
# """ """
# def setUp(self): def setUp(self):
# """ """
# Set up any variables such as dummy objects that will be utilised in Set up any variables such as dummy objects that will be utilised in
# testing methods testing methods
# """ """
# # Setup a blank URL object with an owner # Setup a blank URL object with an owner
# User.objects.create(username='dhaynes', password='password') User.objects.create(username='dhaynes', password='password')
# get_user = User.objects.get(username='dhaynes') get_user = User.objects.get(username='dhaynes')
# get_registered_user = RegisteredUser.objects.get(user=get_user) get_registered_user = RegisteredUser.objects.get(user=get_user)
# URL.objects.create(owner=get_registered_user, short='test') URL.objects.create(owner=get_registered_user, short='test')
# def test_view_get_anon(self): def test_view_get_anon(self):
# """ """
# Test that the view Go link view loads (200 OK) for anon users Test that the view Go link view loads (200 OK) for anon users
# """ """
# response = self.client.get('/view/test') response = self.client.get('/view/test')
# self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
# class DeleteTest(TestCase): class DeleteTest(TestCase):
# """ """
# Test cases for the delete view Test cases for the delete view
# """ """
# def setUp(self): def setUp(self):
# """ """
# Set up any variables such as dummy objects that will be utilised in Set up any variables such as dummy objects that will be utilised in
# testing methods testing methods
# """ """
# # Setup a blank URL object with an owner # Setup a blank URL object with an owner
# User.objects.create(username='dhaynes', password='password') User.objects.create(username='dhaynes', password='password')
# get_user = User.objects.get(username='dhaynes') get_user = User.objects.get(username='dhaynes')
# get_registered_user = RegisteredUser.objects.get(user=get_user) get_registered_user = RegisteredUser.objects.get(user=get_user)
# URL.objects.create(owner=get_registered_user, short='test') URL.objects.create(owner=get_registered_user, short='test')
# def test_delete_get_anon(self): def test_delete_get_anon(self):
# """ """
# Test that the delete view redirects anons to login with cas on an EXTERNAL Test that the delete view redirects anons to login with cas on an EXTERNAL
# CAS link, so 302 REDIRECT. CAS link, so 302 REDIRECT.
# """ """
# response = self.client.get('/delete/test') response = self.client.get('/delete/test')
# self.assertEqual(response.status_code, 302) self.assertEqual(response.status_code, 302)
# class SignupTest(TestCase): class SignupTest(TestCase):
# """ """
# Test cases for the signup view Test cases for the signup view
# """ """
# def test_signup_get_anon(self): def test_signup_get_anon(self):
# """ """
# Test that the signup view redirects anons to login with cas on an EXTERNAL Test that the signup view redirects anons to login with cas on an EXTERNAL
# CAS link, so 302 REDIRECT. CAS link, so 302 REDIRECT.
# """ """
# response = self.client.get('/signup') response = self.client.get('/signup')
# self.assertEqual(response.status_code, 302) self.assertEqual(response.status_code, 302)
# class RedirectionTest(TestCase): class RedirectionTest(TestCase):
# """ """
# Test cases for the redirection view Test cases for the redirection view
# """ """
# def setUp(self): def setUp(self):
# """ """
# Set up any variables such as dummy objects that will be utilised in Set up any variables such as dummy objects that will be utilised in
# testing methods testing methods
# """ """
# # Setup a blank URL object with an owner # Setup a blank URL object with an owner
# User.objects.create(username='dhaynes', password='password') User.objects.create(username='dhaynes', password='password')
# get_user = User.objects.get(username='dhaynes') get_user = User.objects.get(username='dhaynes')
# get_registered_user = RegisteredUser.objects.get(user=get_user) get_registered_user = RegisteredUser.objects.get(user=get_user)
# URL.objects.create(owner=get_registered_user, short='test', target='https://srct.gmu.edu') URL.objects.create(owner=get_registered_user, short='test', target='https://srct.gmu.edu')
# def test_redirect_get_anon(self): def test_redirect_get_anon(self):
# """ """
# Test that redirection works as intentioned on anon users. Test that redirection works as intentioned on anon users.
# """ """
# response = self.client.get('/test') response = self.client.get('/test')
# self.assertEqual(response.status_code, 302) self.assertEqual(response.status_code, 302)
# class StaffMemberRequiredTest(TestCase): class StaffMemberRequiredTest(TestCase):
# """ """
# Test cases for the staff_member_required() helper function Test cases for the staff_member_required() helper function
# """ """
# def test_django_test(self): def test_django_test(self):
# """ """
# Default test case, does not actually test anything Default test case, does not actually test anything
# """ """
# self.assertEqual("Hello World!", "Hello World!") self.assertEqual("Hello World!", "Hello World!")
# class UserAdminTest(TestCase): class UserAdminTest(TestCase):
# """ """
# Test cases for the useradmin view Test cases for the useradmin view
# """ """
# def test_useradmin_get_anon(self): def test_useradmin_get_anon(self):
# """ """
# Test that the useradmin view redirects anons to login with cas on an EXTERNAL Test that the useradmin view redirects anons to login with cas on an EXTERNAL
# CAS link, so 302 REDIRECT. CAS link, so 302 REDIRECT.
# """ """
# response = self.client.get('/useradmin') response = self.client.get('/useradmin')
# self.assertEqual(response.status_code, 302) self.assertEqual(response.status_code, 302)
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