diff --git a/tests/videodinges/unit/models/test_get_short_name_of_transcoding_type.py b/tests/videodinges/unit/models/test_get_short_name_of_transcoding_type.py new file mode 100644 index 0000000..0b409e5 --- /dev/null +++ b/tests/videodinges/unit/models/test_get_short_name_of_transcoding_type.py @@ -0,0 +1,12 @@ +from django.test import TestCase +from videodinges.models import TranscodingType, get_short_name_of_transcoding_type + +class GetShortNameOfTranscodingTypeTestCase(TestCase): + + def test_gets_transcoding_by_name(self): + result = get_short_name_of_transcoding_type('video/webm; codecs="vp8, vorbis"') + self.assertEqual(result, 'vp8') + + def test_gets_transcoding_by_transcoding_object(self): + result = get_short_name_of_transcoding_type(TranscodingType(name='Looooong naaaaame', short_name='shrt nm')) + self.assertEqual(result, 'shrt nm') \ No newline at end of file