Use SimpleTestCase for unit tests

This commit is contained in:
2020-05-09 14:43:22 +02:00
parent 61c178d222
commit 8e6a36212d
3 changed files with 6 additions and 4 deletions

View File

@@ -1,4 +1,6 @@
"""
Module for storing 'real' _unit_ tests.
Meaning, they should test single small units e.g. methods or functions in an isolated way.
Try to use django.test.SimpleTestCase to prevent unnecessary database setup and improve speed.
"""

View File

@@ -1,7 +1,7 @@
from django.test import TestCase
from django.test import SimpleTestCase
from videodinges.models import get_quality_by_name
class GetQualityByNameTestCase(TestCase):
class GetQualityByNameTestCase(SimpleTestCase):
def test_returns_quality_if_listed(self):
result = get_quality_by_name('480p')

View File

@@ -1,7 +1,7 @@
from django.test import TestCase
from django.test import SimpleTestCase
from videodinges.models import TranscodingType, get_short_name_of_transcoding_type
class GetShortNameOfTranscodingTypeTestCase(TestCase):
class GetShortNameOfTranscodingTypeTestCase(SimpleTestCase):
def test_gets_transcoding_by_name(self):
result = get_short_name_of_transcoding_type('video/webm; codecs="vp8, vorbis"')