add more tests (#268)

* add more tests as STUBS
This commit is contained in:
Markos Gogoulos
2021-08-17 00:01:52 +03:00
committed by GitHub
parent 755df50c41
commit fb00f94bfa
29 changed files with 922 additions and 663 deletions

View File

@@ -0,0 +1,10 @@
from django.test import TestCase
class TestX(TestCase):
fixtures = ["fixtures/categories.json", "fixtures/encoding_profiles.json"]
def test_X(self):
# check only managers/editors/admins have access here!!!
pass

View File

@@ -0,0 +1,10 @@
from django.test import TestCase
class TestX(TestCase):
fixtures = ["fixtures/categories.json", "fixtures/encoding_profiles.json"]
def test_X(self):
# test a number of listings works (index, featured, user etc)
pass

View File

@@ -0,0 +1,9 @@
from django.test import TestCase
class TestX(TestCase):
fixtures = ["fixtures/categories.json", "fixtures/encoding_profiles.json"]
def test_X(self):
# add new file, check it is added and more (eg for videos it is transcoded etc)
pass

View File

@@ -0,0 +1,10 @@
from django.test import TestCase
class TestX(TestCase):
fixtures = ["fixtures/categories.json", "fixtures/encoding_profiles.json"]
def test_X(self):
# add a few files, check search different cases that work
pass

View File

@@ -0,0 +1,9 @@
from django.test import TestCase
class TestX(TestCase):
fixtures = ["fixtures/categories.json", "fixtures/encoding_profiles.json"]
def test_X(self):
# test contact form, send a message and check on email box that it is received
pass

View File

@@ -0,0 +1,12 @@
from django.test import TestCase
class TestX(TestCase):
fixtures = ["fixtures/categories.json", "fixtures/encoding_profiles.json"]
def test_X(self):
# test edit media that it works, by setting different values. then check on the API response
# check that a user cannot set status upon different scenarios (eg on settings PORTAL_WORKFLOW)
# check that changint thumbnail time produces a different thumbnail?
# check adding custom poster, and that it appears instead of the autogenerated?
pass

View File

@@ -0,0 +1,9 @@
from django.test import TestCase
class TestX(TestCase):
fixtures = ["fixtures/categories.json", "fixtures/encoding_profiles.json"]
def test_X(self):
# test edit profile page that it stores correctly the data
pass

View File

@@ -0,0 +1,12 @@
from django.test import TestCase
class TestX(TestCase):
fixtures = ["fixtures/categories.json", "fixtures/encoding_profiles.json"]
def test_X(self):
# test login form that allows user to login
# test login form that redirect has worked (if on a page that required redirect for login, eg edit profile?)
# check upon setting change that it is not allowed
pass

View File

@@ -0,0 +1,13 @@
from django.test import TestCase
class TestX(TestCase):
fixtures = ["fixtures/categories.json", "fixtures/encoding_profiles.json"]
def test_X(self):
# test media upload, using the form.
# 1. upload a file and then check that it appears on the listing
# 2. check that the page has been created
# 3. check that encodings are ok for videos
# 4. check other things (eg pdf/audio/image)
pass

View File

@@ -0,0 +1,10 @@
from django.test import TestCase
class TestX(TestCase):
fixtures = ["fixtures/categories.json", "fixtures/encoding_profiles.json"]
def test_X(self):
# test register form that stores user data correctly
# check upon setting change that it is not allowed
pass

View File

@@ -0,0 +1,9 @@
from django.test import TestCase
class TestX(TestCase):
fixtures = ["fixtures/categories.json", "fixtures/encoding_profiles.json"]
def test_X(self):
# test that adding a subtitle works for a video - needs to have a language set on Admin
pass

View File

@@ -0,0 +1,9 @@
from django.test import TestCase
class TestX(TestCase):
fixtures = ["fixtures/categories.json", "fixtures/encoding_profiles.json"]
def test_X(self):
# add comment, check user is notified
pass

View File

@@ -0,0 +1,10 @@
from django.test import TestCase
class TestX(TestCase):
fixtures = ["fixtures/categories.json", "fixtures/encoding_profiles.json"]
def test_X(self):
# add media, check on mailbox that admins are notified
pass

View File

@@ -0,0 +1,10 @@
from django.test import TestCase
class TestX(TestCase):
fixtures = ["fixtures/categories.json", "fixtures/encoding_profiles.json"]
def test_X(self):
# report media, check on mailbox that admin/user are notified
pass

View File

@@ -0,0 +1,11 @@
from django.test import TestCase
class TestX(TestCase):
fixtures = ["fixtures/categories.json", "fixtures/encoding_profiles.json"]
def test_X(self):
# check that all links exist, on anonymous user
# check that all links exist, on logged in user, plus the user specific
# for editor/manager/admin, check that the related links exist
pass

View File

@@ -0,0 +1,9 @@
from django.test import TestCase
class TestX(TestCase):
fixtures = ["fixtures/categories.json", "fixtures/encoding_profiles.json"]
def test_X(self):
# check that links exist from index page and pages are loading and only admins/editors/managers can see them
pass

View File

@@ -0,0 +1,11 @@
from django.test import TestCase
class TestX(TestCase):
fixtures = ["fixtures/categories.json", "fixtures/encoding_profiles.json"]
def test_X(self):
# test what is the default portal workflow
# change it and make sure nothing strange happens (public/unlisted/private)
pass

View File

@@ -0,0 +1,13 @@
from django.test import TestCase
class TestX(TestCase):
fixtures = ["fixtures/categories.json", "fixtures/encoding_profiles.json"]
def test_X(self):
# test extra things editor can do
# test extra things manager can do
# test extra things admin can do
# test what single user cannot do (eg mess with other users content!)
pass

35
tests/test_fixtures.py Normal file
View File

@@ -0,0 +1,35 @@
from django.test import TestCase
from files.models import Category, EncodeProfile
class TestFixtures(TestCase):
fixtures = ["fixtures/categories.json", "fixtures/encoding_profiles.json"]
def test_categories_fixtures(self):
categories = Category.objects.all()
self.assertEqual(
categories.count(),
6,
"Problem with category fixtures",
)
categories = Category.objects.filter().order_by('id')
self.assertEqual(
categories.first().title,
'Art',
"Problem with category fixtures",
)
def test_encodeprofile_fixtures(self):
profiles = EncodeProfile.objects.all()
self.assertEqual(
profiles.count(),
21,
"Problem with Encode Profile fixtures",
)
profiles = EncodeProfile.objects.filter(active=True)
self.assertEqual(
profiles.count(),
6,
"Problem with Encode Profile fixtures, not as active as expected",
)