added tests for storage edit

This commit is contained in:
vabene1111
2020-03-17 18:22:13 +01:00
parent 6fcbc9f0cd
commit deeda425a8
3 changed files with 55 additions and 7 deletions

View File

@@ -6,8 +6,19 @@ from django.test import TestCase, Client
class TestBase(TestCase):
def setUp(self):
self.client = Client()
self.anonymous_client = Client()
self.client.force_login(User.objects.get_or_create(username='test')[0])
self.client = Client()
self.client.force_login(User.objects.get_or_create(username='client')[0])
user = auth.get_user(self.client)
self.assertTrue(user.is_authenticated)
self.another_client = Client()
self.another_client.force_login(User.objects.get_or_create(username='another_client')[0])
user = auth.get_user(self.another_client)
self.assertTrue(user.is_authenticated)
self.superuser_client = Client()
self.superuser_client.force_login(User.objects.get_or_create(username='superuser_client', is_superuser=True)[0])
user = auth.get_user(self.superuser_client)
self.assertTrue(user.is_authenticated)