Unverified Commit 3d9b0fad authored by David Haynes's avatar David Haynes
Browse files

Simple test the /edit/[short]

- Test that anon cannot edit someone's link
parent c5c6f293
Pipeline #1180 passed with stage
in 59 seconds
......@@ -108,13 +108,28 @@ class EditTest(TestCase):
Test cases for the edit view
def test_django_test(self):
def setUp(self):
Default test case, does not actually test anything
Set up any variables such as dummy objects that will be utilised in
testing methods
self.assertEqual("Hello World!", "Hello World!")
# Setup a blank URL object with an owner
User.objects.create(username='dhaynes', password='password')
get_user = User.objects.get(username='dhaynes')
get_registered_user = RegisteredUser.objects.get(user=get_user)
URL.objects.create(owner=get_registered_user, short='test')
def test_edit_get_anon(self):
Test that the delete view redirects anons to login with cas on an EXTERNAL
CAS link, so 302 REDIRECT.
response = self.client.get('/edit/test')
self.assertEqual(response.status_code, 302)
class DeleteTest(TestCase):
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