[videos] Fix saving imdb_id duplicates
All checks were successful
build & deploy / test (push) Successful in 2m1s
build & deploy / deploy (push) Successful in 22s

This commit is contained in:
2026-03-21 14:35:39 -04:00
parent a36abacfbd
commit 190f486c49
5 changed files with 88 additions and 68 deletions

View File

@ -0,0 +1,17 @@
import pytest
from videos.models import Video
@pytest.mark.django_db
class TestVideoFindOrCreate:
def test_find_or_create_with_none_returns_none(self):
result = Video.find_or_create(None)
assert result is None
def test_find_or_create_with_empty_string_returns_none(self):
result = Video.find_or_create("")
assert result is None
def test_find_or_create_with_invalid_id_returns_none(self):
result = Video.find_or_create("invalid-id")
assert result is None